-->
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.  [ 2 posts ] 
Author Message
 Post subject: @AccessType("Property") - Is there a problem ir disadvantage
PostPosted: Mon Apr 26, 2010 5:14 pm 
Newbie

Joined: Thu Apr 01, 2010 6:09 pm
Posts: 8
We prefer having field access to all properties in our domain objects. but due to the lazy initialization exception (due to proxy being initialized) on calling the getId(), we have second thoughts.

But we see that using @AccessType("Property") on top of the id field solves this problem.

In hibernate documentation, they say

Quote:
@org.hibernate.annotations.AccessType
The annotation @org.hibernate.annotations.AccessType should be considered deprecated for FIELD and PROPERTY access. It is still useful however if you need to use a custom access type


Does this mean that this approach of using AccessType("property") is discouraged?

Can any one please enlighten me on any of the disadvange associted with this approach?


Top
 Profile  
 
 Post subject: Re: @AccessType("Property") - Is there a problem ir disadvantage
PostPosted: Wed Apr 28, 2010 12:39 am 
Newbie

Joined: Thu Apr 01, 2010 6:09 pm
Posts: 8
here is a compilation that is related to this topic
field versus property access in hibernate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.