Package io.permazen.core
Class ObjType
java.lang.Object
io.permazen.core.SchemaItem
io.permazen.core.ObjType
Represents a
Database
object type.-
Method Summary
Modifier and TypeMethodDescriptioncreate
(Transaction tx) Create a new database object of this type in the given transaction.getCompositeIndex
(String name) Get theCompositeIndex
associated with this instance with the given name.Get all composite indexes associated with this object type keyed by name.Field<?>
getField
(int storageId) Get theField
in this instance with the given storage ID.Field<?>
Get theField
in this instance with the given name.NavigableMap<String,
Field<?>> Get all fields associated with this object type keyed by name.NavigableMap<String,
Field<?>> Get all fields associated with this object type keyed by name.toString()
Methods inherited from class io.permazen.core.SchemaItem
getName, getSchema, getSchemaId, getStorageId
-
Method Details
-
create
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 transactionStaleTransactionException
- iftx
no longer usableIllegalArgumentException
- iftx
is null
-
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
Get theField
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
Get theField
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
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
Get all composite indexes associated with this object type keyed by name.- Returns:
- unmodifiable mapping from name to composite index
-
getCompositeIndex
Get theCompositeIndex
associated with this instance with the given name.- Parameters:
name
- index name- Returns:
- the named
CompositeIndex
- Throws:
UnknownIndexException
- if no such index exists
-
toString
- Specified by:
toString
in classSchemaItem
-