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 DatabaseEngine
The field for thedatabaseEngine
record component.private final String
The field for thedatabaseName
record component.private final SqlOperation
The field for thesqlOperation
record component.private final List
<TableMetadata> The field for thetableMetadataList
record component. -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseMetadata
(String databaseName, DatabaseEngine databaseEngine, SqlOperation sqlOperation, List<TableMetadata> tableMetadataList) Creates an instance of aDatabaseMetadata
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTableMetadata
(TableMetadata tableMetadata) Adds a new table metadata to the database.Returns the value of thedatabaseEngine
record component.Returns the value of thedatabaseName
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 thesqlOperation
record component.Returns the value of thetableMetadataList
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
databaseName
The field for thedatabaseName
record component. -
databaseEngine
The field for thedatabaseEngine
record component. -
sqlOperation
The field for thesqlOperation
record component. -
tableMetadataList
The field for thetableMetadataList
record component.
-
-
Constructor Details
-
DatabaseMetadata
public DatabaseMetadata(String databaseName, DatabaseEngine databaseEngine, SqlOperation sqlOperation, List<TableMetadata> tableMetadataList) Creates an instance of aDatabaseMetadata
record class.- Parameters:
databaseName
- the value for thedatabaseName
record componentdatabaseEngine
- the value for thedatabaseEngine
record componentsqlOperation
- the value for thesqlOperation
record componenttableMetadataList
- the value for thetableMetadataList
record component
-
-
Method Details
-
addTableMetadata
Adds a new table metadata to the database.- Parameters:
tableMetadata
- TheTableMetadata
to 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 thedatabaseName
record component.- Returns:
- the value of the
databaseName
record component
-
databaseEngine
Returns the value of thedatabaseEngine
record component.- Returns:
- the value of the
databaseEngine
record component
-
sqlOperation
Returns the value of thesqlOperation
record component.- Returns:
- the value of the
sqlOperation
record component
-
tableMetadataList
Returns the value of thetableMetadataList
record component.- Returns:
- the value of the
tableMetadataList
record component
-