Java Composite entity Mode ~

Source: Internet
Author: User

The combined entity pattern is used for the EJB persistence mechanism. A composite entity is an EJB entity bean that represents an object graph. When a composite entity is updated, the internal dependency object Bean is automatically updated to be managed by the EJB entity Bean. The following are the participants in the composite entity bean.

    • Composite Entities -it is the primary entity bean. It can be coarse-grained or can contain coarse-grained objects for persistence purposes.

    • coarse-Grained object -This object contains dependent objects. It has its own life cycle and manages the life cycle of the dependent objects.

    • Dependent object -a dependent object is an object, depending on its persistent life-cycle coarse-grained object.

    • Policy -policy represents how to implement complex composite entities.

Implementing an instance

In the example of this implementation, the object is created CompositeEntity as a CompositeEntityCoarseGrainedObjectis a class that contains dependent objects. CompositeEntityPatternDemois a demo class that uses Client classes to demonstrate the use of composite entity patterns.

The structure of the composite entity pattern example is as shown in-

Click on the link to view the details

Java Composite entity Mode ~

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.