-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate and private accessor methods
PostPosted: Mon Mar 14, 2005 12:45 pm 
Newbie

Joined: Tue Feb 22, 2005 4:10 pm
Posts: 19
In Hibernate In Action:
"Hibernate doesn't require that accessor methods be declared public; it can easily use private accessors for property management."

How is this possible? Wouldn't Hibernate classes be outside of this class and therefore forbidden from accessing anything "private"?

Thanks,
NG


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 12:46 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Uhm, thats basic Java reflection which makes it possible.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 12:56 pm 
Newbie

Joined: Tue Feb 22, 2005 4:10 pm
Posts: 19
christian wrote:
Uhm, thats basic Java reflection which makes it possible.


Sorrrrryyyyy! Don't much abut Java reflection, but did figure it was something like that.

Thanks for the answer though.

NG


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 08, 2005 12:41 pm 
Beginner
Beginner

Joined: Fri Jul 08, 2005 12:38 pm
Posts: 41
Location: Massachusetts, USA
It's possible, but it's not the recommended way to do it because setters and getters may do more than just assign or return a private variable (like validation and other business logic).


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