-->
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: Persisting property with no setter and no field
PostPosted: Tue Jan 25, 2005 6:06 pm 
Newbie

Joined: Tue Jan 18, 2005 11:13 pm
Posts: 19
I have a unique component in which I'm attempting to persist a instance of an interface with no Setter methods. Is this a possiblity?

Scott


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 6:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can persist pretty much anything using custom PropertyAccessors and UserTypes


Top
 Profile  
 
 Post subject: Custom PropertyAccessor
PostPosted: Tue Jan 25, 2005 6:22 pm 
Newbie

Joined: Tue Jan 18, 2005 11:13 pm
Posts: 19
I just noticed the PropertyAccessor interface and I figure that I can create an implementation that returns a mock setter (i.e. one that doesn't do anything).

Without a deep understanding of Hibernate, I don't know what implications this might have. Are there any pitfalls that I'm going to run into?

Scott


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2005 2:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
a mock setter?

hibernate uses the returned Setter instance to "inject" the property values into your object model.

so a setter that did nothing would mean you'd get back an object which had no set value for that property.


Top
 Profile  
 
 Post subject: Write Only Object
PostPosted: Wed Jan 26, 2005 3:20 pm 
Newbie

Joined: Tue Jan 18, 2005 11:13 pm
Posts: 19
This particular object is to be write only. In other words, it's the resposibility of another system to read the records.


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.