Hi (again :(),
I have :
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.diatem.src.Team" table="teams">
<id name="id" column="team_id" type="long" unsaved-value="null">
<generator class="sequence"/>
</id>
<property name="name" column="team_name" type="string" length="15" not-null="true"/>
<property name="city" column="city" type="string" length="15" not-null="true"/>
<set name="players" cascade="all" inverse="true" lazy="true">
<key column="team_id"/>
<one-to-many class="com.diatem.src.Player"/>
</set>
</class>
</hibernate-mapping>
and
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.diatem.src.Player" table="players" mutable="true" polymorphism="implicit" dynamic-update="false" dynamic-insert="false">
<composite-id name="compId" class="com.diatem.src.PlayerID" unsaved-value="none">
<key-property name="alias" column="alias_" type="string"/>
</composite-id>
<property name="firstName" column="first_name" type="string" length="12" not-null="true"/>
<property name="lastName" column="last_name" type="string" length="15" not-null="true"/>
<property name="draftDate" column="draft_date" type="date"/>
<property name="annualSalary" column="salary" type="float"/>
<property name="jerseyNumber" column="jersey_number" type="integer" length="2" not-null="true"/>
<many-to-one name="team" class="com.diatem.src.Team" column="team_id"/>
</class>
</hibernate-mapping>
and I get:
...................
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
Hibernate: values nextval for hibernate_sequence
Hibernate: insert into teams (team_name, city, team_id) values (?, ?, ?)
Hibernate: update players set first_name=?, last_name=?, draft_date=?, salary=?, jersey_number=?, team_id=? where alias_=?
com.diatem.persistence.BusinessException: net.sf.hibernate.HibernateException: SQL update or deletion failed (row not found)
at com.diatem.persistence.PersistentSession.flush(PersistentSession.java:44)
at com.diatem.src.Main.testSaveTeam(Main.java:140)
at com.diatem.src.Main.go(Main.java:54)
at com.diatem.src.Main.main(Main.java:34)
Caused by: net.sf.hibernate.HibernateException: SQL update or deletion failed (row not found)
at net.sf.hibernate.impl.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:25)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:642)
at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:611)
at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:31)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2100)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2062)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2005)
at com.diatem.persistence.HibernateSession.flush(HibernateSession.java:52)
at com.diatem.persistence.PersistentSession.flush(PersistentSession.java:42)
... 3 more
Please help !
Thanks very much,
--steve
|