Interface ColumnMapping

All Known Implementing Classes:
ColumnSpec, ManyToMany, MultiColumnSpec, OneToMany

public sealed interface ColumnMapping permits ColumnSpec, ManyToMany, MultiColumnSpec, OneToMany
Represents a base type for various kinds of database column mappings.

The ColumnMapping interface serves as a common contract for modelling different types of mappings between fields in a data transfer object (DTO) and database expressions. It is a sealed interface, allowing only specific permitted implementations to be used.

Permitted implementations:

  • ColumnSpec: Direct mapping between a DTO field and a single database column, with optional configuration for auto-increment and value generation.
  • OneToMany: One-to-many relationship, where a DTO field maps to a collection of related database rows
  • ManyToMany: Many-to-many relationship, where a DTO field maps to related entities through an intermediate join table.
  • MultiColumnSpec: Multiple columns mapping to a single field, such as a related DTO via a composite foreign key.