-->
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.  [ 3 posts ] 
Author Message
 Post subject: Composite-id example anyone
PostPosted: Thu Nov 06, 2003 10:33 pm 
Newbie

Joined: Tue Sep 23, 2003 5:19 pm
Posts: 11
Is there a good example of how to use composite-id keys?

I have managed to read objects with composite id values from the database but cannot save a new one back to the database.

The documentation says that you implement Interceptor.isUnsaved() but gives no details. When I added this interface to my class I found that the method was never called.

I did find that calling save() directly did persist the object to the database.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 11:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You do NOT implement Interceptor.isUnsaved() on the persistent class. You implement it in an Interceptor. Please see the documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 11:16 pm 
Newbie

Joined: Tue Sep 23, 2003 5:19 pm
Posts: 11
Thanks, I implemented my own instance of Inceptor.

The method is correctly called on a SaveOrUpdate() passing the object I whish to persist as a parameter.

Now all I have to do is return a TRUE or FALSE.

But how do I do that with out exposing the innards of my object to Inceptor (and hence the rest of the word).......Could add a isNew() method I guess.


Oh, for an example, How much time one could save!


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