Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: custom query for a Entity's getter method
PostPosted: Wed Apr 04, 2012 4:33 pm 
Newbie

Joined: Fri Sep 09, 2005 11:11 am
Posts: 19
Please review the following class

Code:
@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, associated_member a where
   * c.company_code = a.company_code and c.employee = %NAME% 
    */
  public String getCompanyName {

  }
}


Is there any JPA annotation that would allow me to define a custom query just for the above getter method, getCompanyName()? What would be the best solution for this scenario?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.