Results 1 to 1 of 1
  1. #1
    zollen is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default custom query for a Entity's getter method?

    Please review the following class

    @Entity
    @Table(name="CUSTOMER")
    public class Customer {
    @Column(name="NAME")
    public String getName() { return name; }
    @Column(name="ADDRESS")
    public String getAddress() { return address; }

    /* select company_name from company_master c, associate_member a where
    * c.company_code = a.company_code and c.employee = %NAME%
    */
    public String getCompanyName {

    }

    }


    Is there any JPA annotation that allows me to define a custom query just for the above getter method, getCompanyName()? What would be the best solution for this scenario?
    Last edited by zollen; 04-05-2012 at 01:33 AM.

Similar Threads

  1. getter and setter method using Jcreator
    By couline in forum New To Java
    Replies: 7
    Last Post: 01-22-2012, 02:02 PM
  2. Replies: 0
    Last Post: 01-06-2012, 10:03 PM
  3. Unable to access getter method in an object class I made
    By EnSlavingBlair in forum New To Java
    Replies: 6
    Last Post: 10-01-2011, 10:52 AM
  4. getter and setter method help please!
    By merdzins in forum New To Java
    Replies: 2
    Last Post: 12-06-2010, 05:06 AM
  5. problem in getter method
    By freddieMaize in forum Advanced Java
    Replies: 5
    Last Post: 05-26-2008, 07:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •