-->
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: questions about persisting collections
PostPosted: Mon Oct 30, 2006 1:29 am 
Beginner
Beginner

Joined: Mon Jun 19, 2006 4:10 pm
Posts: 27
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?


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.