Hibernate annotation @jointable Description

Source: Internet
Author: User

Tag:ar    use    sp    data    on   log    bs   ef    database    

Table Association (@JoinTable) Note Description:
@Target ({METHOD, FIELD})
Public @interface jointable{
String name () default "";
String catalog () default "";
String schema () default "";
Joincolumn[] Joincolumns () default {};
Joincolumn[] Inversejoincolumns () default {};
Uniqueconstraint[] uniqueconstraints default {};
}
# The Name property is the table names that connect two tables. If not specified, the default table name is used, in the following format:
"Table Name 1" + "_" + "Table Name 2"
The # Joincolumn property represents a field that holds the foreign key of the associated relationship in the table that holds the relationship, and is used with the @joincolumn tag;
# The Inversejoincolumn property is similar to Joincolumn, which holds another foreign key field for the save relationship;
# The catalog and schema properties represent the entity's specified point directory name or database name;
# The Uniqueconstraints property represents the unique constraint that the entity is associated with, an entity can have more than one unique constraint, and no constraint by default;

Note: @JoinTable not only be able to define a one-to-many association, but also to define a many-to-many table association.

Hibernate annotation @jointable Description

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.