Hello,
I'm new to Hibernate and have what I am sure is a simple problem.
I have two classes like this:
Code:
class Order {
Lond id;
Date ts;
double amount;
State state;
// getters and setters...
}
class State {
Long id;
String desc;
int qty;
...
}
The mapping for Order is summarised:
Code:
<class name="Order" table="ORDER">
<id name="id" column="ORDER_ID">
<generator class="native"/>
</id>
<property name="ts" type="timestamp" column="TS"/>
<property name="amount"/>
<one-to-one name="state" cascade='all'/>
</class>
and for State:
Code:
<class name="State" table="STATE">
<id name="id" column="STATE_ID">
<generator class="native"/>
</id>
<property name="desc"/>
<property name="qty"/>
</class>
the problem: I can save order objects ok, but the state field never gets persisted - its always null.
I'm sure its solvable but I can't see it - any tips appreciated :)
Thanks!