Java EE notes (iii)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.