The cache is stored through the map
One-to-one relationship configuration in hibernate
// // Class a{ private int ID; private String name; private b b;} class b{ private int ID; private String name; private a A;}
Primary Key Association<!--Two objects must confirm that they are assigned the same identifier B configuration file ID configuration parameters - <IDname= "id"column= "id"type= "int"> <Generatorclass= "Foreugn"> <paramname= "Property">A</param> </Generator> </ID> <!--if it is a primary key association, constrained must be true cascade Cascade because A and b cascade, so storage A is also stored b a file configuration parameters <one-to-one> Add properties Cascade = "All" Session.save (A); - <one-to-onename= "a"class= "Com.my.bean.a"constrained= "true"/>Unique Foreign Key Association<!--Unique : The only <many-to-one> is a one-to-many - <Many-to-onename= "a"class= "Com.my.bean.a"Unique= "true"/>
Java EE notes (iii)