Hallo,
I have a class Person with the sets Address and CommunicationInfo. If I save a Person, I get just UPDATEs for the sets instead of INSERTS:
INFO: schema export complete
Hibernate: select hibernate_sequence.nextval from dual
Hibernate: insert into Person (Client, Surname, Maidenname, Forename, Title, Martialstatus, Religion, Birthday, Placeofbirth, Socialsecuritynumber, Spokenlanguages, "Comment", id) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: update CommunicationInfo set client=?, "Comment"=?, ConnectionType=?, Connection=? where id=?
Hibernate: update Address set id=? where id=?
Hibernate: update Address set id=? where id=?
The Person.hbm.xml file is:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="ena.bl">
<class name="Person" table="Person">
<id name="id">
<generator class="native"/>
</id>
<property name="Client"/>
<property name="Surname"/>
<property name="Maidenname"/>
<property name="Forename"/>
<property name="Title"/>
<property name="Martialstatus"/>
<property name="Religion"/>
<property name="Birthday"/>
<property name="Placeofbirth"/>
<property name="Socialsecuritynumber"/>
<property name="Spokenlanguages"/>
<property name="Comment" column="`COMMENT`"/>
<set
name="Address">
<key column="owner_id"/>
<one-to-many class="ena.bl.Address"/>
</set>
<set
name="CommunicationInfo"
<key column="owner_id"/>
<one-to-many class="ena.bl.CommunicationInfo"/>
</set>
</class>
</hibernate-mapping>
Any help? Thank you!
Richard
|