Class ObjType


public class ObjType extends SchemaItem
Represents a Database object type.
  • Method Details

    • create

      public ObjId create(Transaction tx)
      Create a new database object of this type in the given transaction.
      Parameters:
      tx - transaction
      Returns:
      new instance of this type
      Throws:
      UnknownTypeException - if this object type does not exist in the given transaction
      StaleTransactionException - if tx no longer usable
      IllegalArgumentException - if tx is null
    • getFields

      public NavigableMap<String,Field<?>> getFields()
      Get all fields associated with this object type keyed by name. Does not include sub-fields of complex fields.
      Returns:
      unmodifiable mapping from field name to field
    • getField

      public Field<?> getField(String name)
      Get the Field in this instance with the given name.

      For complex sub-fields, specify the name like mymap.key.

      Parameters:
      name - field name
      Returns:
      the named Field
      Throws:
      UnknownFieldException - if no such field exists
    • getField

      public Field<?> getField(int storageId)
      Get the Field in this instance with the given storage ID.

      This does not find sub-fields.

      Parameters:
      storageId - field storage ID
      Returns:
      the corresponding Field
      Throws:
      UnknownFieldException - if no such field exists
    • getFieldsAndSubFields

      public NavigableMap<String,Field<?>> getFieldsAndSubFields()
      Get all fields associated with this object type keyed by name. Includes sub-fields of complex fields.
      Returns:
      unmodifiable mapping from field full name to field
    • getCompositeIndexes

      public NavigableMap<String,CompositeIndex> getCompositeIndexes()
      Get all composite indexes associated with this object type keyed by name.
      Returns:
      unmodifiable mapping from name to composite index
    • getCompositeIndex

      public CompositeIndex getCompositeIndex(String name)
      Get the CompositeIndex associated with this instance with the given name.
      Parameters:
      name - index name
      Returns:
      the named CompositeIndex
      Throws:
      UnknownIndexException - if no such index exists
    • toString

      public String toString()
      Specified by:
      toString in class SchemaItem