Record Class DatabaseMetadata
java.lang.Object
java.lang.Record
dimstyl.orm.metadata.DatabaseMetadata
- Record Components:
databaseName- The name of the database.databaseEngine- The database engine used (e.g., H2, SQLite, Derby).sqlOperation- The SQL operation associated with this metadata.tableMetadataList- The list of table metadata objects.
- All Implemented Interfaces:
Metadata
public record DatabaseMetadata(String databaseName, DatabaseEngine databaseEngine, SqlOperation sqlOperation, List<TableMetadata> tableMetadataList)
extends Record
implements Metadata
Represents metadata for a database, including its name, engine, SQL operations, and tables.
This record is used to store metadata about a database, including its name, database engine, supported SQL operations, and the list of tables it contains.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DatabaseEngineThe field for thedatabaseEnginerecord component.private final StringThe field for thedatabaseNamerecord component.private final SqlOperationThe field for thesqlOperationrecord component.private final List<TableMetadata> The field for thetableMetadataListrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseMetadata(String databaseName, DatabaseEngine databaseEngine, SqlOperation sqlOperation, List<TableMetadata> tableMetadataList) Creates an instance of aDatabaseMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTableMetadata(TableMetadata tableMetadata) Adds a new table metadata to the database.Returns the value of thedatabaseEnginerecord component.Returns the value of thedatabaseNamerecord 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 thesqlOperationrecord component.Returns the value of thetableMetadataListrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
databaseName
The field for thedatabaseNamerecord component. -
databaseEngine
The field for thedatabaseEnginerecord component. -
sqlOperation
The field for thesqlOperationrecord component. -
tableMetadataList
The field for thetableMetadataListrecord component.
-
-
Constructor Details
-
DatabaseMetadata
public DatabaseMetadata(String databaseName, DatabaseEngine databaseEngine, SqlOperation sqlOperation, List<TableMetadata> tableMetadataList) Creates an instance of aDatabaseMetadatarecord class.- Parameters:
databaseName- the value for thedatabaseNamerecord componentdatabaseEngine- the value for thedatabaseEnginerecord componentsqlOperation- the value for thesqlOperationrecord componenttableMetadataList- the value for thetableMetadataListrecord component
-
-
Method Details
-
addTableMetadata
Adds a new table metadata to the database.- Parameters:
tableMetadata- TheTableMetadatato add.- Throws:
NullPointerException- if tableMetadata 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). -
databaseName
Returns the value of thedatabaseNamerecord component.- Returns:
- the value of the
databaseNamerecord component
-
databaseEngine
Returns the value of thedatabaseEnginerecord component.- Returns:
- the value of the
databaseEnginerecord component
-
sqlOperation
Returns the value of thesqlOperationrecord component.- Returns:
- the value of the
sqlOperationrecord component
-
tableMetadataList
Returns the value of thetableMetadataListrecord component.- Returns:
- the value of the
tableMetadataListrecord component
-