Annotation Interface OneToMany
The `mappedByField` attribute specifies the field in the child entity that owns the relationship. It is essential to correctly define this attribute to maintain bidirectional associations between parent and child entities.
Attributes: - `mappedByField`: Declares the name of the field in the child entity that acts as the owner of the relationship.
This annotation is primarily applied to fields or methods in an entity class to indicate the one-to-many association. Litebridge leverages this metadata to manage cascading operations and other relational operations.
Example Use Case: - A `Department` entity can have a one-to-many relationship with `Employee` entities, where the `mappedByField` specifies the field in the `Employee` entity referencing the `Department`.
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionSpecifies the name of the field in the child entity that owns the relationship in a bidirectional association.
-
Element Details
-
mappedByField
String mappedByFieldSpecifies the name of the field in the child entity that owns the relationship in a bidirectional association. This attribute is typically used in the context of Object-Relational Mapping (ORM) to establish a one-to-many relationship.- Returns:
- The name of the field in the child entity that represents the owning side of the relationship.
-