Hibernate entity Mapping template

Source: Internet
Author: User

Hibernate entity Mapping template

1, write a comment? format:? attribute, which is the expression of this object with? Of Relationship. Example: "department attribute, this object and department's many-to-one" 2, copy Template:

Many-to-one

<many-to-one name= "" class= "" column= ""/>

one-to-many

( set

<set Name= "";

        <key Column= "" ></KEY>

        <one-to-many class= ""/>

</SET>

Many-to-many

( Set )

<set name= "" table= "" >

<key column= "" ></key>

<many-to-many class= "" column= ""/>

</set>



3, fill in the blanks:? Name property: Property name (the 1th question mark in the note)? Class Property: The associated entity type (the 2nd question mark in the note)? Column property:? <many-to-onecolumn= "..." Generally written as a property name plus an ID suffix, if the property is Department, the column value is written as DepartmentID. One-to-many <keycolumn= "..." : Copy the column value from the associated party (the other party is a many-to-one) mapping. <keycolumn= "..." Generally, the name of this object and the ID suffix can be written, if this object is named user, it is written as UserID. <many-to-manycolumn= "..." Generally, it can be written as the name of the associated object plus the ID suffix.


additions and deletions to the use of 6 a Action template for Method

/** list * /

Public String list () throws Exception {return"list";}

/** Delete * /

Public String Delete () throws Exception {return"toList";}

/** Add Page * /

Public String Addui ()throws Exception {return"saveui";}

/** Add * /

Public String Add () throws Exception {return"toList";}

/** Modify Page * /

Public String Editui ()throws Exception {return"saveui";}

/** Modify * /

Public String edit () throws Exception {return"toList";}


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.