-->
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.  [ 2 posts ] 
Author Message
 Post subject: [newbie] table problems in a parent-child relationship
PostPosted: Mon Jan 09, 2006 8:31 pm 
Newbie

Joined: Mon Jan 09, 2006 8:14 pm
Posts: 3
I an new to Hibernate and I am overwhelmed by what it has to offer me. I am confused and appreciate any help.

this is what my hbm file looks like:

Code:
<hibernate-mapping>
   <class name="parent" schema ="refdb">
      <composite-id>
         <key-property name="key1"/>
         <key-property name="key2"/>
      </composite-id>
      <property name="field1"/>
      <property name="field2"/>

      <list name="children" table="child-subTable" schema="refdb">
      <key>
         <column name="key1"/>
         <column name="key2"/>
      </key>
      <index cloumn="posn"/>
      <composite-element class="children">
         <proerty name="childField1"/>
         <proerty name="childField2"/>
      </composite-element?
      </list>
   </class>
</hibernate-mapping>


There is a 1-many relationship between parent and child.

When I run the program, the collection List of Children keeps getting inserted and deleted and continues on until a General hinbernate exception is thrown.

Could someone please check my code and verify that it is correct and explain to me what is going on?

Many Thanks[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 8:13 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
this cannot be your code: you have proerty instead of property

Code:
<proerty name="childField1"/>
<proerty name="childField2"/>


If this is just a typo, please add your java code and the stack strace.

Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.