A couple of relationships Consider an ONE class, one of the ONE classes to store the associated MANY objects, and there is a reference to the ONE class associated with it. The two class HBM configuration files are as follows: One.hbm.xml: column> generator> id> key> one-to-man> set> class> hibernate-mapping >
Many.hbm.xml: color copumn> generator> id> colorn> many-to-one> class> hibernate-maping>
Test.java:
One one = new one (); one.setoneid ("one"); MANY MANY1 = New Many (); Many1.SetManyID ("m1"); Many1.setone (one); Many Many2 = New Many (); MANY2 .SETMANYID ("M2"); Many2.Setone (one); session.save (one); tx.commit (); results and joint inserts are not implemented, only ONE objects