-->
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: Strange behaviour with distinct composite identifiers
PostPosted: Thu Jun 23, 2011 10:11 am 
Newbie

Joined: Wed Jun 22, 2011 8:59 am
Posts: 1
I have a strange behaviour, in the context of a training exercise that aims to show the need to implement the equals and hashcode methods in a composite identifier class.
I instantiate a composite identifier class twice, with the same property values. Then, I invoke the session.get method on the corresponding persistent class twice, respectively providing the first and second composite identifier instances.
As I didn't (yet) implement the equals and hashcode methods in the composite identifier class, I should see two SQL SELECT traces, but I only see one, for the first session.get method invocation.
With debug trace level, I have a
Quote:
resolved object in session cache
trace. It seems that the object is resolved through comparison of the property values of the distinct composite identifier instances.
Did I miss something here ?
Any help would be highly appreciated.


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.