Record Class TableMetadata
java.lang.Object
java.lang.Record
dimstyl.orm.metadata.TableMetadata
- Record Components:
tableName
- The name of the table.uniqueConstraints
- An array ofUniqueConstraint
applied to the table.columnMetadataList
- A list containingColumnMetadata
for 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 thecolumnMetadataList
record component.private final String
The field for thetableName
record component.private final UniqueConstraint[]
The field for theuniqueConstraints
record component. -
Constructor Summary
ConstructorsConstructorDescriptionTableMetadata
(String tableName, UniqueConstraint[] uniqueConstraints, List<ColumnMetadata> columnMetadataList) Creates an instance of aTableMetadata
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addColumnMetadata
(ColumnMetadata columnMetadata) Adds a column's metadata to the table's column metadata list.Returns the value of thecolumnMetadataList
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thetableName
record component.final String
toString()
Returns a string representation of this record class.Returns the value of theuniqueConstraints
record component.
-
Field Details
-
tableName
-
uniqueConstraints
The field for theuniqueConstraints
record component. -
columnMetadataList
The field for thecolumnMetadataList
record component.
-
-
Constructor Details
-
TableMetadata
public TableMetadata(String tableName, UniqueConstraint[] uniqueConstraints, List<ColumnMetadata> columnMetadataList) Creates an instance of aTableMetadata
record class.- Parameters:
tableName
- the value for thetableName
record componentuniqueConstraints
- the value for theuniqueConstraints
record componentcolumnMetadataList
- the value for thecolumnMetadataList
record component
-
-
Method Details
-
addColumnMetadata
Adds a column's metadata to the table's column metadata list.- Parameters:
columnMetadata
- TheColumnMetadata
to be added.- Throws:
NullPointerException
- ifcolumnMetadata
is 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 theuniqueConstraints
record component.- Returns:
- the value of the
uniqueConstraints
record component
-
columnMetadataList
Returns the value of thecolumnMetadataList
record component.- Returns:
- the value of the
columnMetadataList
record component
-