-->
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.  [ 1 post ] 
Author Message
 Post subject: Why there is no method like containsObject(class,id)?
PostPosted: Wed Jan 18, 2006 4:58 am 
Newbie

Joined: Thu Apr 28, 2005 2:18 pm
Posts: 4
Hi

I need a session method to determine if an object of specified class is already associated with the session.
When I call session.get(class,id), I obtain an instance of the given class, but I don't know if that instance was already associated with the session or was just loaded.
I have the id and the class of the object and only need some data. I don't change it and don't want to save it at the end, just release it. But when I call evict at the end of my function to prevent NonUniqueObjectExceptions I would loose a possible instance that is in use in other parts of the program and still needs to be saved.
I have found several similar topics on that problem but no usefull answers.

My questions:
1. How can I write a function like containsObject(class,id)
2. Why does the Hibernate team not tell us why there is no such function (any deep reasons?) or if it is planned in future releases?

Thanks for your help
Bruno


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.