Class PgCompositeType

All Implemented Interfaces:
IHashable, ISearchPath, IStatement

public final class PgCompositeType extends AbstractType
PostgreSQL composite type implementation. Represents a composite type consisting of multiple attributes (fields), similar to a table row structure but used as a data type.
  • Constructor Details

    • PgCompositeType

      public PgCompositeType(String name)
      Creates a new PostgreSQL composite type.
      Parameters:
      name - type name
  • Method Details

    • appendComments

      public void appendComments(SQLScript script)
      Description copied from class: PgStatement
      Appends comment SQL to the script if this statement has comments.
      Overrides:
      appendComments in class PgStatement
      Parameters:
      script - the SQL script to append comments to
    • appendAlterComments

      public void appendAlterComments(PgStatement newObj, SQLScript script)
      Description copied from class: PgStatement
      Appends ALTER comment SQL if the comment has changed.
      Overrides:
      appendAlterComments in class PgStatement
      Parameters:
      newObj - the new statement to compare comments with
      script - the SQL script to append ALTER comments to
    • getAttr

      public AbstractColumn getAttr(String name)
      Returns an attribute by name.
      Parameters:
      name - attribute name
      Returns:
      attribute or null if not found
    • getAttrs

      public List<AbstractColumn> getAttrs()
      Returns an unmodifiable list of all attributes.
      Returns:
      list of attributes
    • addAttr

      public void addAttr(AbstractColumn attr)
      Adds an attribute to this composite type.
      Parameters:
      attr - attribute to add
    • compare

      public boolean compare(PgStatement obj)
      Description copied from class: PgStatement
      This method does not account for nested child PgStatements. Shallow version of PgStatement.equals(Object)
      Overrides:
      compare in class AbstractType
    • computeHash

      public void computeHash(Hasher hasher)
      Description copied from interface: IHashable
      Computes the hash of the implementing object using the provided hasher. The implementation should call appropriate put methods on the hasher for all fields that should contribute to the hash value.
      Parameters:
      hasher - the hasher instance to use for hash computation