Record Class Relationship
java.lang.Object
java.lang.Record
nl.datasteel.crudcraft.codegen.descriptor.field.part.Relationship
- Record Components:
relationshipType
- the type of the relationshipmappedBy
- the mappedBy field for the relationshiptargetType
- the target type of the relationshiptargetCrud
- 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 Summary
ConstructorsConstructorDescriptionRelationship
(RelationshipType relationshipType, String mappedBy, String targetType, boolean targetCrud, boolean embedded) Creates an instance of aRelationship
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
embedded()
Returns the value of theembedded
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the mappedBy field for the relationship.Returns the type of the relationship.Returns the target type of the relationship.final int
hashCode()
Returns a hash code value for this object.boolean
Returns true if the field is embedded.boolean
Returns true if the target is a CRUD entity.mappedBy()
Returns the value of themappedBy
record component.Returns the value of therelationshipType
record component.boolean
Returns the value of thetargetCrud
record component.Returns the value of thetargetType
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Relationship
public Relationship(RelationshipType relationshipType, String mappedBy, String targetType, boolean targetCrud, boolean embedded) Creates an instance of aRelationship
record class.- Parameters:
relationshipType
- the value for therelationshipType
record componentmappedBy
- the value for themappedBy
record componenttargetType
- the value for thetargetType
record componenttargetCrud
- the value for thetargetCrud
record componentembedded
- the value for theembedded
record component
-
-
Method Details
-
getRelationshipType
Returns the type of the relationship.- Returns:
- the type of the relationship
-
getMappedBy
Returns the mappedBy field for the relationship.- Returns:
- the mappedBy field
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
relationshipType
Returns the value of therelationshipType
record component.- Returns:
- the value of the
relationshipType
record component
-
mappedBy
Returns the value of themappedBy
record component.- Returns:
- the value of the
mappedBy
record component
-
targetType
Returns the value of thetargetType
record component.- Returns:
- the value of the
targetType
record component
-
targetCrud
public boolean targetCrud()Returns the value of thetargetCrud
record component.- Returns:
- the value of the
targetCrud
record component
-
embedded
public boolean embedded()Returns the value of theembedded
record component.- Returns:
- the value of the
embedded
record component
-