Record Class ObjectReference
java.lang.Object
java.lang.Record
org.pgcodekeeper.core.database.api.schema.ObjectReference
- Record Components:
schema- the schema nametable- the table namecolumn- the column nametype- the database object type
- All Implemented Interfaces:
Serializable
public record ObjectReference(String schema, String table, String column, DbObjType type)
extends Record
implements Serializable
Represents an object reference with schema, table, column, and type information.
Used for identifying and referencing database objects across different contexts.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionObjectReference(String schema, String table, String column, DbObjType type) Creates an instance of aObjectReferencerecord class.ObjectReference(String schema, String object, DbObjType type) Creates an object reference for a database object within a schema.ObjectReference(String schema, DbObjType type) Creates an object reference for a schema-level object. -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.getName()Gets the name of the most specific object component.final inthashCode()Returns a hash code value for this object.schema()Returns the value of theschemarecord component.table()Returns the value of thetablerecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ObjectReference
Creates an object reference for a database object within a schema.- Parameters:
schema- the schema nameobject- the object name (table, view, function, etc.)type- the database object type
-
ObjectReference
Creates an object reference for a schema-level object.- Parameters:
schema- the schema nametype- the database object type
-
ObjectReference
Creates an instance of aObjectReferencerecord class.
-
-
Method Details
-
getName
Gets the name of the most specific object component.- Returns:
- the column name if present, otherwise table name, otherwise schema name
-
getFullName
-
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). -
schema
Returns the value of theschemarecord component.- Returns:
- the value of the
schemarecord component
-
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-