-->
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: Composite Key Not loaded when querying or getting / loading
PostPosted: Tue Jul 01, 2008 5:45 pm 
Newbie

Joined: Sun Aug 21, 2005 11:36 am
Posts: 6
Hi,

I have a simple Trade class with a composite id defined below.

I create the Trade fine and save it. I have checked and the table is correctly populated.

I have a handle of the trade I created and I evict it and I try to read it again from the DB. I do get an instance (from load as well as a criteria query) yet:
- the composite id object null;
- when doing getIdentifier(object) it does return the correct identifier.

Any obvious issue with what I am doing and why I get this weird result?

Thanks in advance-
Jean

Hibernate version: 3.2.[4 or 3]

Mapping documents:
<hibernate-mapping default-lazy="false">
<class name="Trade" table="trade" batch-size="64" lazy="false">
<synchronize table="contract"/>
<synchronize table="instrument"/>
<composite-id name="id" class="Identifier">
<key-property name="version" column="tradeVersion"/>
<key-property name="id" type="string" column="tradeId"/>
</composite-id>

<property name="price"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:
Hsqldb

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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.