Hibernate's Cascade properties and Inverse properties

Source: Internet
Author: User

1.cascade Properties

The purpose of the Cascade property is to describe the cascading nature of the associated object as it operates, and only the element that involves the relationship has the Cascade attribute. Tags with cascade attributes include <many-to-one/>, <one-to-one/>, <any/>, <set/>, <bag/>, <idbag/> , <list/> and <array/>.

Note that:<one-to-many/> and <many-to-many/> are used inside the collection tag, so the Cascade property is not required.

2.inverse Properties

Inverse describes how an association between objects is maintained. It can reverse the task of maintaining the associated relationship, which is done by the other party. Inverse only exists in the element of the collection tag, and when Inverse is true, the "one" side reverses the association relationship to the "many" side. In the association relationship, the inverse is the active side of false, and the active side is responsible for maintaining the association relationship.

Inverse refers to the control direction of the association relationship, and Cascade refers to the chain operation between the levels.

Related Article

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.