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