Class FieldMetadata

    • Field Detail

      • _isArray

        protected boolean _isArray
      • _fieldTypeID

        protected int _fieldTypeID
    • Constructor Detail

      • FieldMetadata

        public FieldMetadata​(ClassMetadata classMetadata)
      • FieldMetadata

        protected FieldMetadata​(int fieldTypeID)
      • FieldMetadata

        public FieldMetadata​(ClassMetadata containingClass,
                             java.lang.String name,
                             int fieldTypeID,
                             boolean primitive,
                             boolean isArray,
                             boolean isNArray)
      • FieldMetadata

        protected FieldMetadata​(ClassMetadata containingClass,
                                java.lang.String name)
    • Method Detail

      • translatorStoredClass

        protected final java.lang.Class translatorStoredClass​(ObjectTranslator translator)
      • setAvailable

        protected void setAvailable()
      • addIndexEntry

        protected final void addIndexEntry​(StatefulBuffer a_bytes,
                                           java.lang.Object indexEntry)
      • addIndexEntry

        public void addIndexEntry​(Transaction trans,
                                  int parentID,
                                  java.lang.Object indexEntry)
      • createFieldIndexKey

        protected FieldIndexKey createFieldIndexKey​(int parentID,
                                                    java.lang.Object indexEntry)
      • indexEntryFor

        protected java.lang.Object indexEntryFor​(java.lang.Object indexEntry)
      • canUseNullBitmap

        public boolean canUseNullBitmap()
      • removeIndexEntry

        public void removeIndexEntry​(Transaction trans,
                                     int parentID,
                                     java.lang.Object indexEntry)
      • alive

        public boolean alive()
      • updating

        public boolean updating()
      • coerce

        public java.lang.Object coerce​(ReflectClass valueClass,
                                       java.lang.Object value)
      • canLoadByIndex

        public final boolean canLoadByIndex()
      • cascadingTarget

        protected final java.lang.Object cascadingTarget​(ActivationContext context)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • get

        public final java.lang.Object get​(java.lang.Object onObject)
        Description copied from interface: StoredField
        returns the field value on the passed object.

        This method will also work, if the field is not present in the current version of the class.

        It is recommended to use this method for refactoring purposes, if fields are removed and the field values need to be copied to other fields.
        Specified by:
        get in interface StoredField
      • get

        public final java.lang.Object get​(Transaction trans,
                                          java.lang.Object onObject)
      • fieldTypeID

        public int fieldTypeID()
      • getOn

        public java.lang.Object getOn​(Transaction trans,
                                      java.lang.Object onObject)
      • getOrCreate

        public java.lang.Object getOrCreate​(Transaction trans,
                                            java.lang.Object onObject)
        dirty hack for com.db4o.types some of them (BlobImpl) need to be set automatically TODO: Derive from FieldMetadata for Db4oTypes
      • hasConfig

        public boolean hasConfig()
      • hasIndex

        public boolean hasIndex()
        Description copied from interface: StoredField
        Returns whether this field has an index or not.
        Specified by:
        hasIndex in interface StoredField
        Returns:
        true if this field has an index.
      • init

        public final void init​(java.lang.String name)
      • init

        public void init​(java.lang.String name,
                         int fieldTypeID,
                         boolean isPrimitive,
                         boolean isArray,
                         boolean isNArray)
      • isArray

        public boolean isArray()
        Description copied from interface: StoredField
        returns true if the field is an array.
        Specified by:
        isArray in interface StoredField
      • loadFieldTypeById

        public void loadFieldTypeById()
      • needsArrayAndPrimitiveInfo

        public boolean needsArrayAndPrimitiveInfo()
      • rename

        public void rename​(java.lang.String newName)
        Description copied from interface: StoredField
        modifies the name of this stored field.

        After renaming one or multiple fields the ObjectContainer has to be closed and reopened to allow internal caches to be refreshed.

        Specified by:
        rename in interface StoredField
        Parameters:
        newName - the new name
      • set

        public void set​(java.lang.Object onObject,
                        java.lang.Object obj)
      • traverseValues

        public final void traverseValues​(Visitor4 userVisitor)
        Description copied from interface: StoredField
        specialized highspeed API to collect all values of a field for all instances of a class, if the field is indexed.

        The field values will be taken directly from the index without the detour through class indexes or object instantiation.

        If this method is used to get the values of a first class object index, deactivated objects will be passed to the visitor.
        Specified by:
        traverseValues in interface StoredField
        Parameters:
        userVisitor - the visitor to be called with each index value.
      • traverseValues

        public final void traverseValues​(Transaction transaction,
                                         Visitor4 userVisitor)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • initIndex

        public void initIndex​(Transaction systemTrans,
                              int id)
      • newBTree

        protected final BTree newBTree​(Transaction systemTrans,
                                       int id)
      • isPrimitive

        public boolean isPrimitive()
      • createIndex

        public void createIndex()
        Description copied from interface: StoredField
        creates an index on this field at runtime.
        Specified by:
        createIndex in interface StoredField
      • dropIndex

        public void dropIndex()
        Description copied from interface: StoredField
        drops an existing index on this field at runtime.
        Specified by:
        dropIndex in interface StoredField
      • canUpdateFast

        public boolean canUpdateFast()