-->
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: Error inserting one-to-many
PostPosted: Thu Aug 09, 2007 2:19 pm 
Newbie

Joined: Wed May 30, 2007 4:14 pm
Posts: 15
Data Model:
----SOLDIER----
soldierId pk

-----ADDRESS-----
addressId pk
soldierId fk

A soldier can have one-to-many addresses. I'm trying to insert a soldier that has a collection of addresses. My soldierId fk is not being populated in the POJO and is failing on insert for that reason. Anyone see a reason this isn't working???


Hibernate version: 3. 2.3

Mapping documents:
<class name=x>
<properties..../>
<set name="addresses" lazy="false" cascade="save-update" inverse="true">
<key column="soldierId" not-null="true"/>
<one-to-many class="com.futuresoldiers.user.Address"/>
</set>
</class>

<class name="address>
<id name="addressId" type="long" column="ADDRESS_ID">
<generator class="TriggerAssignedIdentityGenerator"/>
</id>
<property name="soldierId" type="long" column="SOLDIER_ID"/>
</class>

Full stack trace of any exception that occurs:
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
Caused by: java.sql.SQLException: ORA-00904: "SOLDIER_ID": invalid identifier
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)

Name and version of the database you are using: Oracle 10G -10.2.0.1.0


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.