Package com.db4o.internal
Class ClassMetadata
- java.lang.Object
-
- com.db4o.internal.Identifiable
-
- com.db4o.internal.PersistentBase
-
- com.db4o.internal.ClassMetadata
-
- All Implemented Interfaces:
StoredClass
,LinkLengthAware
,Persistent
- Direct Known Subclasses:
PrimitiveTypeMetadata
public class ClassMetadata extends PersistentBase implements StoredClass
-
-
Field Summary
Fields Modifier and Type Field Description ClassMetadata
_ancestor
ClassAspect[]
_aspects
protected TypeHandler4
_typeHandler
For reference types, _typeHandler always holds a StandardReferenceTypeHandler that will use the _aspects of this class to take care of its business.-
Fields inherited from class com.db4o.internal.Identifiable
_id, _state
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ClassMetadata(ObjectContainerBase container)
ClassMetadata(ObjectContainerBase container, ReflectClass classReflector)
-
Method Summary
-
Methods inherited from class com.db4o.internal.PersistentBase
free, idSystem, linkLength, newWriteBuffer, produceReadBuffer, produceWriteBuffer, read, read, readBufferById, slotChangeFactory, write, writeOwnID
-
Methods inherited from class com.db4o.internal.Identifiable
beginProcessing, endProcessing, getID, hashCode, isActive, isNew, setID, setStateClean, setStateDeactivated, setStateDirty
-
-
-
-
Field Detail
-
_typeHandler
protected TypeHandler4 _typeHandler
For reference types, _typeHandler always holds a StandardReferenceTypeHandler that will use the _aspects of this class to take care of its business. A custom type handler would appear as a TypeHandlerAspect in that case. For value types, _typeHandler always holds the actual value type handler be it a custom type handler or a builtin one.
-
_ancestor
public ClassMetadata _ancestor
-
_aspects
public ClassAspect[] _aspects
-
-
Constructor Detail
-
ClassMetadata
protected ClassMetadata(ObjectContainerBase container)
-
ClassMetadata
public ClassMetadata(ObjectContainerBase container, ReflectClass classReflector)
-
-
Method Detail
-
isInternal
public boolean isInternal()
-
cascadeActivation
public void cascadeActivation(ActivationContext context)
-
addFieldIndices
public final void addFieldIndices(StatefulBuffer buffer)
-
aspectsAreInitialized
public boolean aspectsAreInitialized()
-
descendOnCascadingActivation
public boolean descendOnCascadingActivation()
-
checkType
public void checkType()
-
isDb4oTypeImpl
public boolean isDb4oTypeImpl()
-
adjustUpdateDepth
public final UpdateDepth adjustUpdateDepth(Transaction trans, UpdateDepth depth)
-
cascadesOnDeleteOrUpdate
public boolean cascadesOnDeleteOrUpdate()
-
adjustCollectionDepthToBorders
public FixedActivationDepth adjustCollectionDepthToBorders(FixedActivationDepth depth)
-
updateDepthFromConfig
public final int updateDepthFromConfig()
-
collectConstraints
public void collectConstraints(Transaction trans, QConObject parentConstraint, java.lang.Object obj, Visitor4 visitor)
-
collectIDs
public final void collectIDs(CollectIdContext context, java.lang.String fieldName)
-
collectIDs
public final void collectIDs(CollectIdContext context)
-
collectIDs
public void collectIDs(QueryingReadContext context)
-
config
public Config4Class config()
-
configOrAncestorConfig
public Config4Class configOrAncestorConfig()
-
deactivate
public void deactivate(Transaction trans, ObjectInfo reference, ActivationDepth depth)
-
forceDeactivation
public void forceDeactivation(Transaction trans, ActivationDepth depth, java.lang.Object obj)
-
delete
public void delete(DeleteContext context) throws Db4oIOException
- Throws:
Db4oIOException
-
cascadeOnDeleteTernary
public TernaryBool cascadeOnDeleteTernary()
-
cascadeOnDelete
public boolean cascadeOnDelete()
-
dispatchEvent
public final boolean dispatchEvent(Transaction trans, java.lang.Object obj, int message)
-
hasEventRegistered
public final boolean hasEventRegistered(Transaction trans, int eventID)
-
declaredAspectCount
public final int declaredAspectCount()
-
aspectCount
public final int aspectCount()
-
seekToField
public final HandlerVersion seekToField(Transaction trans, ByteArrayBuffer buffer, FieldMetadata field)
-
seekToField
public final boolean seekToField(ObjectHeaderContext context, ClassAspect field)
-
generateUUIDs
public boolean generateUUIDs()
-
generateCommitTimestamps
public boolean generateCommitTimestamps()
-
getAncestor
public ClassMetadata getAncestor()
-
getComparableObject
public java.lang.Object getComparableObject(java.lang.Object forObject)
-
getHigherHierarchy
public ClassMetadata getHigherHierarchy(ClassMetadata a_classMetadata)
-
getHigherOrCommonHierarchy
public ClassMetadata getHigherOrCommonHierarchy(ClassMetadata a_classMetadata)
-
getIdentifier
public byte getIdentifier()
- Specified by:
getIdentifier
in interfacePersistent
-
getIDs
public long[] getIDs()
Description copied from interface:StoredClass
returns an array of IDs of all stored object instances of this stored class.- Specified by:
getIDs
in interfaceStoredClass
-
getIDs
public long[] getIDs(Transaction trans)
-
hasClassIndex
public boolean hasClassIndex()
Description copied from interface:StoredClass
returns true if this StoredClass has a class index.- Specified by:
hasClassIndex
in interfaceStoredClass
-
hasVersionField
public boolean hasVersionField()
-
index
public ClassIndexStrategy index()
-
indexEntryCount
public int indexEntryCount(Transaction ta)
-
classReflector
public ReflectClass classReflector()
-
getName
public java.lang.String getName()
Description copied from interface:StoredClass
returns the name of this stored class.- Specified by:
getName
in interfaceStoredClass
-
getParentStoredClass
public StoredClass getParentStoredClass()
Description copied from interface:StoredClass
returns the StoredClass for the parent of the class, this StoredClass represents.- Specified by:
getParentStoredClass
in interfaceStoredClass
-
getStoredFields
public StoredField[] getStoredFields()
Description copied from interface:StoredClass
returns all stored fields of this stored class.- Specified by:
getStoredFields
in interfaceStoredClass
-
container
public final ObjectContainerBase container()
-
fieldMetadataForName
public FieldMetadata fieldMetadataForName(java.lang.String name)
-
hasField
public boolean hasField(ObjectContainerBase container, java.lang.String fieldName)
- Parameters:
container
-
-
holdsAnyClass
public boolean holdsAnyClass()
-
instantiate
public java.lang.Object instantiate(UnmarshallingContext context)
-
onInstantiate
protected final void onInstantiate(UnmarshallingContext context, java.lang.Object obj)
-
instantiateTransient
public java.lang.Object instantiateTransient(UnmarshallingContext context)
-
hasObjectConstructor
public boolean hasObjectConstructor()
-
isTranslated
public boolean isTranslated()
-
isArray
public boolean isArray()
-
isDirty
public boolean isDirty()
- Overrides:
isDirty
in classIdentifiable
-
hasIdentity
public boolean hasIdentity()
-
isStronglyTyped
public boolean isStronglyTyped()
no any, primitive, array or other tricks. overridden in YapClassAny and YapClassPrimitive
-
isValueType
public boolean isValueType()
-
nameToWrite
public java.lang.String nameToWrite()
-
callConstructor
public final boolean callConstructor()
-
ownLength
public int ownLength()
- Specified by:
ownLength
in interfacePersistent
-
readCandidateHandler
public TypeHandler4 readCandidateHandler(QueryingReadContext context)
-
seekCandidateHandler
public TypeHandler4 seekCandidateHandler(QueryingReadContext context)
-
readAspectCount
public final int readAspectCount(ReadBuffer buffer)
-
readName1
public final byte[] readName1(Transaction trans, ByteArrayBuffer reader)
-
readVirtualAttributes
public void readVirtualAttributes(Transaction trans, ObjectReference ref, boolean lastCommitted)
-
reflector
public GenericReflector reflector()
-
rename
public void rename(java.lang.String newName)
Description copied from interface:StoredClass
renames this stored class.
After renaming one or multiple classes the ObjectContainer has to be closed and reopened to allow internal caches to be refreshed.
.NET: As the name you should provide [Classname, Assemblyname]- Specified by:
rename
in interfaceStoredClass
- Parameters:
newName
- the new name
-
readThis
public void readThis(Transaction a_trans, ByteArrayBuffer a_reader)
- Specified by:
readThis
in interfacePersistent
-
refresh
public void refresh()
-
storedField
public StoredField storedField(java.lang.String fieldName, java.lang.Object fieldType)
Description copied from interface:StoredClass
returns an existing stored field of this stored class.- Specified by:
storedField
in interfaceStoredClass
- Parameters:
fieldName
- the name of the fieldfieldType
- the type of the field. There are four possibilities how to supply the type:
- a Class object. (.NET: a Type object)
- a fully qualified classname.
- any object to be used as a template.
- null, if the first found field should be returned.- Returns:
- the
StoredField
-
toStaticField
protected StaticField toStaticField(ReflectField reflectField)
-
updateExistingStaticField
protected void updateExistingStaticField(Transaction trans, StaticField existingField, ReflectField reflectField)
-
fieldByName
protected StaticField fieldByName(StaticField[] fields, java.lang.String fieldName)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeObjectBegin
public boolean writeObjectBegin()
- Overrides:
writeObjectBegin
in classPersistentBase
-
writeThis
public final void writeThis(Transaction trans, ByteArrayBuffer writer)
- Specified by:
writeThis
in interfacePersistent
-
prepareComparison
public PreparedComparison prepareComparison(Context context, java.lang.Object source)
-
defragObject
public static void defragObject(DefragmentContextImpl context)
-
defragment
public void defragment(DefragmentContext context)
-
defragClass
public void defragClass(DefragmentContextImpl context, int classIndexID)
-
readClass
public static ClassMetadata readClass(ObjectContainerBase stream, ByteArrayBuffer reader)
-
isAssignableFrom
public boolean isAssignableFrom(ClassMetadata other)
-
setAncestor
public void setAncestor(ClassMetadata ancestor)
-
wrapWithTransactionContext
public java.lang.Object wrapWithTransactionContext(Transaction transaction, java.lang.Object value)
-
typeHandler
public TypeHandler4 typeHandler()
-
delegateTypeHandler
public TypeHandler4 delegateTypeHandler(Context context)
-
correctHandlerVersion
protected TypeHandler4 correctHandlerVersion(HandlerVersionContext context)
-
traverseDeclaredFields
public void traverseDeclaredFields(Procedure4 procedure)
-
traverseDeclaredAspects
public void traverseDeclaredAspects(Procedure4 procedure)
-
aspectsAreNull
public boolean aspectsAreNull()
-
isModified
public boolean isModified(java.lang.Object obj)
-
instanceCount
public int instanceCount()
Description copied from interface:StoredClass
Returns the number of instances of this class that have been persisted to the database, as seen by the transaction (container) that produces this StoredClass instance.- Specified by:
instanceCount
in interfaceStoredClass
- Returns:
- The number of instances
-
instanceCount
public int instanceCount(Transaction trans)
-
isStorable
public boolean isStorable()
-
isStruct
public boolean isStruct()
-
dropClassIndex
public void dropClassIndex()
-
traverseAllAspects
public void traverseAllAspects(TraverseAspectCommand command)
-
detectAspectTraversalStrategy
protected AspectTraversalStrategy detectAspectTraversalStrategy()
-
-