Package com.onec.schema
Record Class TableModel
java.lang.Object
java.lang.Record
com.onec.schema.TableModel
- Record Components:
name- table name (already through the naming strategy)columns- columns in declaration orderconstraints- trailing table constraints rendered verbatim, e.g.PRIMARY KEY (product, warehouse)orUNIQUE (_period, product)previousNames- candidate former table names, in priority order, for rename detection
public record TableModel(String name, List<ColumnModel> columns, List<String> constraints, List<String> previousNames)
extends Record
Desired state of a single table, derived from metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionTableModel(String name, List<ColumnModel> columns, List<String> constraints, List<String> previousNames) Creates an instance of aTableModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumns()Returns the value of thecolumnsrecord component.Returns the value of theconstraintsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thepreviousNamesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TableModel
public TableModel(String name, List<ColumnModel> columns, List<String> constraints, List<String> previousNames) Creates an instance of aTableModelrecord class.- Parameters:
name- the value for thenamerecord componentcolumns- the value for thecolumnsrecord componentconstraints- the value for theconstraintsrecord componentpreviousNames- the value for thepreviousNamesrecord component
-
-
Method Details
-
column
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
constraints
Returns the value of theconstraintsrecord component.- Returns:
- the value of the
constraintsrecord component
-
previousNames
Returns the value of thepreviousNamesrecord component.- Returns:
- the value of the
previousNamesrecord component
-