-->
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: how to save collection of value types
PostPosted: Fri Feb 03, 2006 10:46 am 
Newbie

Joined: Fri Feb 03, 2006 10:37 am
Posts: 1
my class VRCInfoRecord has lot of attributes and a collection of strings.

All the attributes should be saved in the table LOGMIS, the strings from the collection in LOGINFTX.
But it will not work. Hibernate generates just one SQL to insert into LOGMIS but not for LOGINFTX. And there is no exception thrown.

The primary key from the first table should be foreign key in the second.
What's wrong with my xml-File.

Here is my xml-File:

<class name="de.ifbfag.crk.util.log.VRCInfoRecord" table="LOGMIS" >
<id name="id" type="long" column="ID">
<generator class="native" />
</id>

<property name="mandant" type="long" column="NR_MANDANT" />
<property name="stichtag" column="DAT_STICHTAG" type="de.ifbfag.crk.data.datum.UTDate"/>
<property name="timestamp" column="TIMESTAMP" type="com.ifbag.okular.db.datum.UTDateTime"/>
<property name="nrLogDatei" type="int" column="NR_LOG" />

<list name="beschreibung" table="LOGINFTX">
<key column="ID" not-null="true" />
<list-index column="POS" base="1" />
<element column="BESCHREIBUNG" type="string" />

</list>
</class>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 31, 2006 12:14 pm 
Newbie

Joined: Fri Mar 31, 2006 11:11 am
Posts: 2
Location: Mannheim, Germany
Try to initialize the lists in your model class with

private List beschreibung = new ArrayList();

Without any of your Java code this is just a pure guess, but not to initialize the lists can lead to the described behaviour.

_________________
Kai
Don't forget to rate


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.