Record Class TableMetadata
java.lang.Object
java.lang.Record
dimstyl.orm.metadata.TableMetadata
- Record Components:
tableName- The name of the table.uniqueConstraints- An array ofUniqueConstraintapplied to the table.columnMetadataList- A list containingColumnMetadatafor all columns in the table.
- All Implemented Interfaces:
Metadata
public record TableMetadata(String tableName, UniqueConstraint[] uniqueConstraints, List<ColumnMetadata> columnMetadataList)
extends Record
implements Metadata
Represents metadata for a database table, including its name, unique constraints,
and associated column metadata.
This record provides structural details about a database table, such as the table name, unique constraints, and the list of column metadata associated with it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ColumnMetadata> The field for thecolumnMetadataListrecord component.private final StringThe field for thetableNamerecord component.private final UniqueConstraint[]The field for theuniqueConstraintsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTableMetadata(String tableName, UniqueConstraint[] uniqueConstraints, List<ColumnMetadata> columnMetadataList) Creates an instance of aTableMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumnMetadata(ColumnMetadata columnMetadata) Adds a column's metadata to the table's column metadata list.Returns the value of thecolumnMetadataListrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetableNamerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theuniqueConstraintsrecord component.
-
Field Details
-
tableName
-
uniqueConstraints
The field for theuniqueConstraintsrecord component. -
columnMetadataList
The field for thecolumnMetadataListrecord component.
-
-
Constructor Details
-
TableMetadata
public TableMetadata(String tableName, UniqueConstraint[] uniqueConstraints, List<ColumnMetadata> columnMetadataList) Creates an instance of aTableMetadatarecord class.- Parameters:
tableName- the value for thetableNamerecord componentuniqueConstraints- the value for theuniqueConstraintsrecord componentcolumnMetadataList- the value for thecolumnMetadataListrecord component
-
-
Method Details
-
addColumnMetadata
Adds a column's metadata to the table's column metadata list.- Parameters:
columnMetadata- TheColumnMetadatato be added.- Throws:
NullPointerException- ifcolumnMetadatais null.
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
tableName
-
uniqueConstraints
Returns the value of theuniqueConstraintsrecord component.- Returns:
- the value of the
uniqueConstraintsrecord component
-
columnMetadataList
Returns the value of thecolumnMetadataListrecord component.- Returns:
- the value of the
columnMetadataListrecord component
-