Record Class MappedManyToMany

java.lang.Object
java.lang.Record
org.litebridge.orm.persistence.MappedManyToMany
Record Components:
joinOrmTable - The intermediary table that connects two entities in a many-to-many relationship.
joinColumns - The column(s) in the join table that link it to the source entity.
collection - The field in the source entity that holds the collection representing the relationship.
targetOrmTable - : The table representing the target entity in the relationship, resolved lazily.
inverseJoinColumns - The column(s) in the join table that link it to the target entity.
All Implemented Interfaces:
MappedFieldTarget

public record MappedManyToMany(OrmTable joinOrmTable, String[] joinColumns, FieldAccessor collection, Supplier<OrmTable> targetOrmTable, String[] inverseJoinColumns) extends Record implements MappedFieldTarget
A many-to-many relationship mapping in an object-relational mapping (ORM) context.

This record encapsulates metadata related to a join table used to establish the relationship between two entities in a database.

The record provides information regarding the join table, its join columns, and the collection field that represents the relationship in the application layer. It also includes mechanisms to lazily resolve the target table associated with the many-to-many relationship.

  • Constructor Details

    • MappedManyToMany

      public MappedManyToMany(OrmTable joinOrmTable, String[] joinColumns, FieldAccessor collection, Supplier<OrmTable> targetOrmTable, String[] inverseJoinColumns)
      Creates an instance of a MappedManyToMany record class.
      Parameters:
      joinOrmTable - the value for the joinOrmTable record component
      joinColumns - the value for the joinColumns record component
      collection - the value for the collection record component
      targetOrmTable - the value for the targetOrmTable record component
      inverseJoinColumns - the value for the inverseJoinColumns record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • joinOrmTable

      public OrmTable joinOrmTable()
      Returns the value of the joinOrmTable record component.
      Returns:
      the value of the joinOrmTable record component
    • joinColumns

      public String[] joinColumns()
      Returns the value of the joinColumns record component.
      Returns:
      the value of the joinColumns record component
    • collection

      public FieldAccessor collection()
      Returns the value of the collection record component.
      Returns:
      the value of the collection record component
    • targetOrmTable

      public Supplier<OrmTable> targetOrmTable()
      Returns the value of the targetOrmTable record component.
      Returns:
      the value of the targetOrmTable record component
    • inverseJoinColumns

      public String[] inverseJoinColumns()
      Returns the value of the inverseJoinColumns record component.
      Returns:
      the value of the inverseJoinColumns record component