Record Class Relationship

java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.codegen.descriptor.field.part.Relationship
Record Components:
relationshipType - the type of the relationship
mappedBy - the mappedBy field for the relationship
targetType - the target type of the relationship
targetCrud - true if the target is a CRUD entity

public record Relationship(RelationshipType relationshipType, String mappedBy, String targetType, boolean targetCrud, boolean embedded) extends Record
Represents a relationship between entities in a model. This includes the type of relationship, the mappedBy field, the target type, and whether the target is a CRUD entity.
  • Constructor Details

    • Relationship

      public Relationship(RelationshipType relationshipType, String mappedBy, String targetType, boolean targetCrud, boolean embedded)
      Creates an instance of a Relationship record class.
      Parameters:
      relationshipType - the value for the relationshipType record component
      mappedBy - the value for the mappedBy record component
      targetType - the value for the targetType record component
      targetCrud - the value for the targetCrud record component
      embedded - the value for the embedded record component
  • Method Details

    • getRelationshipType

      public RelationshipType getRelationshipType()
      Returns the type of the relationship.
      Returns:
      the type of the relationship
    • getMappedBy

      public String getMappedBy()
      Returns the mappedBy field for the relationship.
      Returns:
      the mappedBy field
    • getTargetType

      public String getTargetType()
      Returns the target type of the relationship.
      Returns:
      the target type
    • isTargetCrud

      public boolean isTargetCrud()
      Returns true if the target is a CRUD entity.
      Returns:
      true if target is a CRUD entity
    • isEmbedded

      public boolean isEmbedded()
      Returns true if the field is embedded.
      Returns:
      true if the field is embedded
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • relationshipType

      public RelationshipType relationshipType()
      Returns the value of the relationshipType record component.
      Returns:
      the value of the relationshipType record component
    • mappedBy

      public String mappedBy()
      Returns the value of the mappedBy record component.
      Returns:
      the value of the mappedBy record component
    • targetType

      public String targetType()
      Returns the value of the targetType record component.
      Returns:
      the value of the targetType record component
    • targetCrud

      public boolean targetCrud()
      Returns the value of the targetCrud record component.
      Returns:
      the value of the targetCrud record component
    • embedded

      public boolean embedded()
      Returns the value of the embedded record component.
      Returns:
      the value of the embedded record component