-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Why @column annotations on getter methods
PostPosted: Sat Apr 29, 2006 2:23 pm 
Newbie

Joined: Thu Apr 21, 2005 12:53 pm
Posts: 1
Hi,
Can any body tell me why we are having column annotation at the top of
getters . Is there any way to include it in the setters

Thanks in advance
Sandeep

_________________
sandeepsnair9


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 30, 2006 7:06 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Look at this attribute:
Code:
access="field|property|ClassName"


Quote:
access (optional - defaults to property): The strategy Hibernate should use for accessing the property value.


Check out PropertyAccessorFactory class.

Rgds, Ales


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 4:21 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
No Hibernate annotations will not parse the setters.
You can put them on fields or getters

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 4:41 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Yep, my misleading post. :-(

Since I saw @AccessType annotation also as TYPE annotation.

Will it work if you define some else (from 'field' or 'property') property accessor?

Rgds, Ales


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 25, 2006 2:23 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes it should work meaning if @AccessType(whatever) is used then the @Id position should lead the parsing (either field or getters)

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

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.