Hibernate version:2.1.7b
Mapping documents: /** * public access for SL Contact ID * This method dereferences an instance of SLContact. * @hibernate.many-to-one column="SL_Contact_ID" unique="true" cascade="all" not-null="true" * @return The related instance of SLContact. */ public SLContact getSLContact() { return slContact; }
Code between sessionFactory.openSession() and session.close(): SLContact c = new SLContact(); SHStakeholder sh = new SHStakeholder(); sh.setSHQuantumNbr("TESTQUANT"); sh.setSLContact(c); c.setFirstname("Craig"); c.setLastname("Main"); c.setMiddlename("Richard"); c.setAccount("PPS"); c.setSeccodeid("PPS"); Object om = session.save(sh); session.flush();
Name and version of the database you are using:SQL Server 2000
My problem is simple.
Given a table with two columns.
ID int identifier
SL_CONTACT_ID varchar(20)
I need the child to update before the parent.
I have read chapter 16. This is different, the relationship is uni-directional.
I have searched some of 3000 forum messages on the topic, but have not found a solution.
Some help would be greatly appreciated.
|