Package com.db4o.internal.handlers
Class StandardReferenceTypeHandler
- java.lang.Object
-
- com.db4o.internal.handlers.StandardReferenceTypeHandler
-
- All Implemented Interfaces:
DeepClone
,Comparable4
,FieldAwareTypeHandler
,VirtualAttributeHandler
,Indexable4
,IndexableTypeHandler
,LinkLengthAware
,ReadsObjectIds
,VersionedTypeHandler
,CascadingTypeHandler
,ReferenceTypeHandler
,TypeHandler4
- Direct Known Subclasses:
StandardReferenceTypeHandler0
public class StandardReferenceTypeHandler extends java.lang.Object implements FieldAwareTypeHandler, IndexableTypeHandler, ReadsObjectIds
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StandardReferenceTypeHandler.PreparedComparisonImpl
-
Constructor Summary
Constructors Constructor Description StandardReferenceTypeHandler()
StandardReferenceTypeHandler(ClassMetadata classMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ReferenceActivationContext context)
gets called when an object is to be activated.void
activateAspects(UnmarshallingContext context)
void
addFieldIndices(ObjectIdContextImpl context)
void
cascadeActivation(ActivationContext context)
will be called during activation if the handled object is already activeClassMetadata
classMetadata()
void
classMetadata(ClassMetadata classMetadata)
void
collectIDs(CollectIdContext context, Predicate4<ClassAspect> predicate)
void
collectIDs(QueryingReadContext context)
will be called during querying to ask for IDs of member objects of the handled object.java.lang.Object
deepClone(java.lang.Object context)
The parameter allows passing one new object so parent references can be corrected on children.void
defragIndexEntry(DefragmentContextImpl context)
void
defragment(DefragmentContext context)
gets called when an object gets defragmented.TypeHandler4
delegateTypeHandler(Context context)
void
delete(DeleteContext context)
gets called when an object gets deleted.void
deleteMembers(DeleteContextImpl context, boolean isUpdate)
protected MarshallingInfo
ensureFieldList(MarshallingInfo context)
boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.Object
indexEntryToObject(Context context, java.lang.Object indexEntry)
int
linkLength()
void
marshallAspects(java.lang.Object obj, MarshallingContext context)
PreparedComparison
prepareComparison(Context context, java.lang.Object source)
creates a prepared comparison to compare multiple objects against one single object.TypeHandler4
readCandidateHandler(QueryingReadContext context)
will be called during querying to ask for the handler to be used to collect children of the handled objectjava.lang.Object
readIndexEntry(ObjectIdContext context)
java.lang.Object
readIndexEntry(Context context, ByteArrayBuffer a_reader)
java.lang.Object
readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer)
ObjectID
readObjectID(InternalReadContext context)
void
readVirtualAttributes(ObjectReferenceContext context)
boolean
seekToField(ObjectHeaderContext context, ClassAspect aspect)
void
traverseAllAspects(MarshallingInfo context, TraverseAspectCommand command)
TypeHandler4
unversionedTemplate()
void
write(WriteContext context, java.lang.Object obj)
gets called when an object is to be written to the database.void
writeIndexEntry(Context context, ByteArrayBuffer a_writer, java.lang.Object a_object)
-
-
-
Constructor Detail
-
StandardReferenceTypeHandler
public StandardReferenceTypeHandler(ClassMetadata classMetadata)
-
StandardReferenceTypeHandler
public StandardReferenceTypeHandler()
-
-
Method Detail
-
defragment
public void defragment(DefragmentContext context)
Description copied from interface:TypeHandler4
gets called when an object gets defragmented.- Specified by:
defragment
in interfaceTypeHandler4
-
delete
public void delete(DeleteContext context) throws Db4oIOException
Description copied from interface:TypeHandler4
gets called when an object gets deleted.- Specified by:
delete
in interfaceTypeHandler4
- Throws:
Db4oIOException
-
activateAspects
public final void activateAspects(UnmarshallingContext context)
-
activate
public void activate(ReferenceActivationContext context)
Description copied from interface:ReferenceTypeHandler
gets called when an object is to be activated.- Specified by:
activate
in interfaceReferenceTypeHandler
-
write
public void write(WriteContext context, java.lang.Object obj)
Description copied from interface:TypeHandler4
gets called when an object is to be written to the database.- Specified by:
write
in interfaceTypeHandler4
obj
- the object
-
marshallAspects
public void marshallAspects(java.lang.Object obj, MarshallingContext context)
-
prepareComparison
public PreparedComparison prepareComparison(Context context, java.lang.Object source)
Description copied from interface:Comparable4
creates a prepared comparison to compare multiple objects against one single object.- Specified by:
prepareComparison
in interfaceComparable4
- Parameters:
context
- the context of the comparisonsource
- the object that is to be compared against multiple other objects- Returns:
- the prepared comparison
-
traverseAllAspects
public final void traverseAllAspects(MarshallingInfo context, TraverseAspectCommand command)
-
ensureFieldList
protected MarshallingInfo ensureFieldList(MarshallingInfo context)
-
classMetadata
public ClassMetadata classMetadata()
-
classMetadata
public void classMetadata(ClassMetadata classMetadata)
- Specified by:
classMetadata
in interfaceFieldAwareTypeHandler
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
unversionedTemplate
public TypeHandler4 unversionedTemplate()
- Specified by:
unversionedTemplate
in interfaceVersionedTypeHandler
-
deepClone
public java.lang.Object deepClone(java.lang.Object context)
Description copied from interface:DeepClone
The parameter allows passing one new object so parent references can be corrected on children.
-
collectIDs
public void collectIDs(CollectIdContext context, Predicate4<ClassAspect> predicate)
- Specified by:
collectIDs
in interfaceFieldAwareTypeHandler
-
cascadeActivation
public void cascadeActivation(ActivationContext context)
Description copied from interface:CascadingTypeHandler
will be called during activation if the handled object is already active- Specified by:
cascadeActivation
in interfaceCascadingTypeHandler
-
readCandidateHandler
public TypeHandler4 readCandidateHandler(QueryingReadContext context)
Description copied from interface:CascadingTypeHandler
will be called during querying to ask for the handler to be used to collect children of the handled object- Specified by:
readCandidateHandler
in interfaceCascadingTypeHandler
- Returns:
-
collectIDs
public void collectIDs(QueryingReadContext context) throws Db4oIOException
Description copied from interface:CascadingTypeHandler
will be called during querying to ask for IDs of member objects of the handled object.- Specified by:
collectIDs
in interfaceCascadingTypeHandler
- Throws:
Db4oIOException
-
readVirtualAttributes
public void readVirtualAttributes(ObjectReferenceContext context)
- Specified by:
readVirtualAttributes
in interfaceFieldAwareTypeHandler
- Specified by:
readVirtualAttributes
in interfaceVirtualAttributeHandler
-
addFieldIndices
public void addFieldIndices(ObjectIdContextImpl context)
- Specified by:
addFieldIndices
in interfaceFieldAwareTypeHandler
-
deleteMembers
public void deleteMembers(DeleteContextImpl context, boolean isUpdate)
- Specified by:
deleteMembers
in interfaceFieldAwareTypeHandler
-
seekToField
public boolean seekToField(ObjectHeaderContext context, ClassAspect aspect)
- Specified by:
seekToField
in interfaceFieldAwareTypeHandler
-
indexEntryToObject
public final java.lang.Object indexEntryToObject(Context context, java.lang.Object indexEntry)
- Specified by:
indexEntryToObject
in interfaceIndexableTypeHandler
-
defragIndexEntry
public final void defragIndexEntry(DefragmentContextImpl context)
- Specified by:
defragIndexEntry
in interfaceIndexable4
-
readIndexEntry
public final java.lang.Object readIndexEntry(Context context, ByteArrayBuffer a_reader)
- Specified by:
readIndexEntry
in interfaceIndexable4
-
readIndexEntryFromObjectSlot
public final java.lang.Object readIndexEntryFromObjectSlot(MarshallerFamily mf, StatefulBuffer statefulBuffer) throws CorruptionException
- Specified by:
readIndexEntryFromObjectSlot
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
-
readIndexEntry
public java.lang.Object readIndexEntry(ObjectIdContext context) throws CorruptionException, Db4oIOException
- Specified by:
readIndexEntry
in interfaceIndexableTypeHandler
- Throws:
CorruptionException
Db4oIOException
-
linkLength
public int linkLength()
- Specified by:
linkLength
in interfaceLinkLengthAware
-
writeIndexEntry
public void writeIndexEntry(Context context, ByteArrayBuffer a_writer, java.lang.Object a_object)
- Specified by:
writeIndexEntry
in interfaceIndexable4
-
delegateTypeHandler
public TypeHandler4 delegateTypeHandler(Context context)
-
readObjectID
public ObjectID readObjectID(InternalReadContext context)
- Specified by:
readObjectID
in interfaceReadsObjectIds
-
-