Package com.db4o.ext
Interface StoredField
-
- All Known Implementing Classes:
CommitTimestampFieldMetadata,FieldMetadata,NullFieldMetadata,StoredFieldImpl,TranslatedAspect,UnknownTypeHandlerAspect,UUIDFieldMetadata,VersionFieldMetadata,VirtualFieldMetadata
public interface StoredFieldthe internal representation of a field on a stored class.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcreateIndex()creates an index on this field at runtime.voiddropIndex()drops an existing index on this field at runtime.java.lang.Objectget(java.lang.Object onObject)returns the field value on the passed object.java.lang.StringgetName()returns the name of the field.ReflectClassgetStoredType()returns the Class (Java) / Type (.NET) of the field.booleanhasIndex()Returns whether this field has an index or not.booleanisArray()returns true if the field is an array.voidrename(java.lang.String name)modifies the name of this stored field.voidtraverseValues(Visitor4 visitor)specialized highspeed API to collect all values of a field for all instances of a class, if the field is indexed.
-
-
-
Method Detail
-
createIndex
void createIndex()
creates an index on this field at runtime.
-
dropIndex
void dropIndex()
drops an existing index on this field at runtime.
-
get
java.lang.Object get(java.lang.Object onObject)
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.
-
getName
java.lang.String getName()
returns the name of the field.
-
getStoredType
ReflectClass getStoredType()
returns the Class (Java) / Type (.NET) of the field.
For array fields this method will return the type of the array. UseisArray()to detect arrays.
-
isArray
boolean isArray()
returns true if the field is an array.
-
rename
void rename(java.lang.String name)
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.- Parameters:
name- the new name
-
traverseValues
void traverseValues(Visitor4 visitor)
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.- Parameters:
visitor- the visitor to be called with each index value.
-
hasIndex
boolean hasIndex()
Returns whether this field has an index or not.- Returns:
- true if this field has an index.
-
-