Im using hibernate 3.
I can persist a list with a composite-element (mapped to another class), but not with a one-to-many. With one2many I dont get any errors, but nothing gets saved or hydrated.
here's the mapping (the one-to-many i tried is commented). If I use composite-element, i dont need to map GameActions, but that is what i tried with one2many...
Code:
<list name="preFlopActions" lazy="false" table="GameActions">
<key column="gameId" not-null="true"/>
<list-index column="actionIndex"/>
<!--one-to-many class="GameAction"/-->
<composite-element class="GameAction">
<property name="amount" column="amount"/>
<property name="player" column="player"/>
<property name="allIn" column="allIn"/>
</composite-element>
</list>
...
<class name="GameAction" table="GameActions">
<id name="gameId" column="gameId" type="long">
<generator class="foreign">
<param name="property">game</param>
</generator>
</id>
<property name="amount"/>
<property name="player"/>
<property name="allIn"/>
</class>
also, I can specify table in either the class or the list, when should i specify in the list element and when in the class?