Skip Headers

# Configuring Private or Independent Relationships

Previous

Next

In TopLink, object relationships can be either private or independent:

- In a private relationship, the target object is a private component of the source object. The target object cannot exist without the source and is accessible only through the source object. Destroying the source object will also destroy the target object.

- In an independent relationship, the source and target objects are public ones that exist independently. Destroying one object does not necessarily imply the destruction of the other.

Tip: TopLink automatically manages private relationships. Whenever an object is written to the database, any private objects it owns are also written to the database. When an object is removed from the database, any private objects it owns are also removed. Be aware of this when creating new systems, since it may affect both the behavior and the performance of your application.

Table: Mapping Support for Private or Independent Relationships summarizes which mappings support this option.

Mapping Support for Private or Independent Relationships

Mapping | Implicitly Private | Private or Independent | Using TopLink Workbench | Using Java
--- | --- | --- | --- | ---
Relational Mappings |  |  |  |
One-to-One Mapping |  |  |  |
Variable One-to-One Mapping |  |  |  |
One-to-Many Mapping |  |  |  |
Many-to-Many Mapping |  |  |  |
Aggregate Collection Mapping |  |  |  |
Direct Collection Mapping |  |  |  |
Direct Map Mapping |  |  |  |
Aggregate Object Mapping |  |  |  |
Object-Relational Mappings |  |  |  |
Object-Relational Structure Mapping |  |  |  |
Object-Relational Reference Mapping |  |  |  |
Object-Relational Array Mapping |  |  |  |
Object-Relational Object Array Mapping |  |  |  |
Object-Relational Nested Table Mapping |  |  |  |
EIS Mappings |  |  |  |
EIS Composite Direct Collection Mapping |  |  |  |
EIS Composite Object Mapping |  |  |  |
EIS Composite Collection Mapping |  |  |  |
EIS One-to-One Mapping |  |  |  |
EIS One-to-Many Mapping |  |  |  |
XML Mappings |  |  |  |
XML Composite Direct Collection Mapping |  |  |  |
XML Composite Object Mapping |  |  |  |
XML Composite Collection Mapping |  |  |  |