-->
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.  [ 6 posts ] 
Author Message
 Post subject: org.hibernate.auction.persistence.DirectSetAccessor
PostPosted: Wed Aug 11, 2004 11:16 am 
Newbie

Joined: Tue Feb 24, 2004 2:02 pm
Posts: 2
While looking at the mapping documents for the User class, I came upon this declaration:

<id name="id"
type="long"
column="USER_ID"
unsaved-value="null"
access="org.hibernate.auction.persistence.DirectSetAccessor">
<generator class="native"/>
</id>

What is the purpose of the DirectSetAccessor class?

Thanks in Advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 11:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
It is a custom PropertyAccessor class.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 11:30 am 
Newbie

Joined: Tue Feb 24, 2004 2:02 pm
Posts: 2
This I can understand. But I was wondering why a custom PropertyAccessor is used in this particular case.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 11:21 pm 
Newbie

Joined: Tue Nov 11, 2003 5:25 pm
Posts: 17
Location: Milwaukee, Wi
I was wondering the same thing myself. Maybe just for demonstration purposes?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 13, 2004 10:55 am 
Regular
Regular

Joined: Mon Feb 23, 2004 10:42 pm
Posts: 102
Location: Washington DC
You can take a look at the source to actually see what it is doing yourself :)

http://cvs.sourceforge.net/viewcvs.py/h ... iew=markup

_________________
Matt Veitas


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 14, 2004 1:19 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I prefer this accessor for immutable properties: It uses a direct field set call, while calling the getter for reads. That way, I don't have to have private setters which are never called in my application code (only by Hibernate). It makes my IDE stop complaining about unused methods.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.