Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can Castor automatically create/remove related objects?

0
10 Posted

Can Castor automatically create/remove related objects?

0

First of all, let’s agree upon terminology. We distinguish dependent and independent objects: -dependent objects are bounded to the parent object’s lifecycle -independent objects have independent lifecycle Thus, dependent objects are created/removed automatically, when their parent object is created/removed, while all operations on independent objects should be performed explicitly. However, with Castor 0.8.x you cannot describe explicitly the kind of object. Instead, the following rule applies: if you have one-to-many relation, and each side of the relation refers to another (Collection attribute on “one” side, simple attribute on “many” side), then “many” side is a dependent object. All other objects are independent. In particular, related objects via one-to-one relation are not created/removed automatically. With Castor 0.9 dependent objects should be described via “depends” attribute of “class” element in mapping configuration file. If you wish some independent object was created a

0

First of all, let’s agree upon terminology. We distinguish dependent and independent objects: dependent objects are bounded to the parent object’s lifecycle, independent objects have independent lifecycle. Thus, dependent objects are created/removed automatically, when their parent object is created/removed, while all operations on independent objects should be performed explicitly.However, with Castor 0.8.x you cannot describe explicitly the kind of object. Instead, the following rule acts: if you have one-to-many relation, and each side of the relation refers to another (Collection attribute on “one” side, simple attribute on “many” side), then “many” side is a dependent object. All other objects are independent. In particular, related objects via one-to-one relation are not created/removed automatically.With Castor 0.9 dependent objects should be described via “depends” attribute of “class” element in mapping configuration file.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123