java.lang.Object
java.lang.Record
org.litebridge.db.spi.Column
- Record Components:
name- Name of the database column.table- Table to which this column belongs.
A database column that belongs to a specific table and optionally has an alias.
It extends the functionality of the Aliased class to include the concept of table association.
Columns can be used to construct queries and represent database metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a newColumninstance without an associatedTableinstance.Creates an instance of aColumnrecord class.Construct a newColumninstance associated with the specified table and column name. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasTable()name()Returns the value of thenamerecord component.Returns the qualified name of the column ("tableName.columnName").table()Returns the value of thetablerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Column
Construct a newColumninstance associated with the specified table and column name.- Parameters:
table- the table to which the column belongs; must not be nullname- the name of the column; must not be null
-
Column
Construct a newColumninstance without an associatedTableinstance.- Parameters:
name- the name of the column; must not be null
-
Column
Creates an instance of aColumnrecord class.
-
-
Method Details
-
hasTable
public boolean hasTable() -
qualifiedName
Returns the qualified name of the column ("tableName.columnName").- Returns:
- the qualified column name
-
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
-
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-