Skip to content

RelationshipMeta

For each @CrudCrafted entity CrudCraft generates a RelationshipMeta helper.

Purpose

It knows how to connect parent and child objects according to your JPA mappings, ensuring both sides of a relationship remain consistent.

Usage

Generated services invoke the helper when saving or deleting entities. Custom code can call link or unlink methods directly if additional processing is required.

Benefits

  • Keeps bidirectional associations in sync
  • Prevents orphaned child records
  • Centralises relationship logic outside of business code