Link Configuration of hibernate

Source: Internet
Author: User

I now have a borrowing information class, such as the following class Borrow {private String borrowId; // borrowing flow private Book book; private User borrowUser; // borrower private Date borrowDate; // borrow Date private Date shouldReturnDate; // The expiration Date private User orderUser; // The reservation person private int renewNum; // the number of times that the account has been renewed private User admin; // The processing business personnel have three property fields for the User, which are the borrower, the reservation person, and the information of the handling person (which should be 1-to-1) below are my User class User {private int userId; private String userName; private String userPwd; Private String userEmail; private String userRole; // user role private String userRight; // the user's permission to borrow books: private float userDebt; // the user's current debt is private int userGetNum; // The total number of books borrowed by the user is private Borrow borrow; (confused !!! Do you want me to write three, so it will certainly be repeated?) Please kindly advise the 1-1 Association Configuration between the two, and store the Foreign keys of the three users in the Borrow table

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.