Hibernate is difficult to encounter difficulties

xiaoxiao2021-03-05  25

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:

Many.hbm.xml:

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

转载请注明原文地址:https://www.9cbs.com/read-33102.html

New Post(0)