Interface PersistenceUnreachableTypeHandler<D,T>
- Type Parameters:
D
-T
-
- All Superinterfaces:
PersistenceDataTypeHolder<D>
,PersistenceLegacyTypeHandler<D,T>
,PersistenceTypeDefinition
,PersistenceTypeDescription
,PersistenceTypeHandler<D,T>
,PersistenceTypeIdentity
,PersistenceTypeIdOwner
,PersistenceTypeLink
- All Known Implementing Classes:
PersistenceUnreachableTypeHandler.Default
public interface PersistenceUnreachableTypeHandler<D,T> extends PersistenceLegacyTypeHandler<D,T>
This is, of course, not a handler that is unreachable, but a handler for a type whose instances are
(decided by the developer) no longer reachable in the entity graph, despite potentially still being present
in a live database, but not having been cleaned up, yet. However, this effectively means that the handler
itself should be kind of "unreachable", too, in the sense that it may never be necessary to access and use it.
Without such a handler, a class could never be removed at the design level without replacement
until the last instance of it has been cleaned up the the storage housekeeping. That is an unpleasent dependency.
The preferable way is to explicitly tell the typing system to "ignore" those types. That is done by registering
a kind of dummy type handler. That dummy handler is this type here.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PersistenceUnreachableTypeHandler.Default<D,T>
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceLegacyTypeHandler
PersistenceLegacyTypeHandler.Abstract<D,T>
Nested classes/interfaces inherited from interface one.microstream.persistence.types.PersistenceTypeDescription
PersistenceTypeDescription.Identity
-
Method Summary
Modifier and Type Method Description default void
complete(D data, T instance, PersistenceLoadHandler handler)
Completes an initially built instance after all loaded instances have been built.default T
create(D data, PersistenceLoadHandler handler)
default Class<D>
dataType()
default void
iterateInstanceReferences(T instance, PersistenceFunction iterator)
default void
iterateLoadableReferences(D data, PersistenceReferenceLoader iterator)
default <C extends Consumer<? super Class<?>>>
CiterateMemberTypes(C logic)
Iterates the types of persistent members (e.g.static <D, T> PersistenceUnreachableTypeHandler<D,T>
New(PersistenceTypeDefinition typeDefinition)
default Class<T>
type()
default void
updateState(D data, T instance, PersistenceLoadHandler handler)
Methods inherited from interface one.microstream.persistence.types.PersistenceLegacyTypeHandler
collectEnumConstants, initialize, store
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDefinition
hasPersistedReferences, hasPersistedVariableLength, hasVaryingPersistedLengthInstances, isPrimitiveType, membersPersistedLengthMaximum, membersPersistedLengthMinimum, runtimeTypeName, toRuntimeTypeIdentifier, typeId, typeName
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeDescription
instancePrimitiveMembers, instanceReferenceMembers, toTypeIdentifier
Methods inherited from interface one.microstream.persistence.types.PersistenceTypeHandler
allMembers, getPersistedEnumOrdinal, guaranteeSpecificInstanceViablity, guaranteeSubTypeInstanceViablity, initializeState, instanceMembers, isSpecificInstanceViable, isSubTypeInstanceViable, isValidEntityType, membersInDeclaredOrder, settingMembers, storingMembers, validateEntityType
-
Method Details
-
dataType
- Specified by:
dataType
in interfacePersistenceDataTypeHolder<D>
- Specified by:
dataType
in interfacePersistenceTypeHandler<D,T>
-
iterateInstanceReferences
- Specified by:
iterateInstanceReferences
in interfacePersistenceTypeHandler<D,T>
-
iterateLoadableReferences
- Specified by:
iterateLoadableReferences
in interfacePersistenceTypeHandler<D,T>
-
type
- Specified by:
type
in interfacePersistenceTypeDefinition
- Specified by:
type
in interfacePersistenceTypeHandler<D,T>
- Specified by:
type
in interfacePersistenceTypeLink
-
create
- Specified by:
create
in interfacePersistenceTypeHandler<D,T>
-
updateState
- Specified by:
updateState
in interfacePersistenceTypeHandler<D,T>
-
complete
Description copied from interface:PersistenceTypeHandler
Completes an initially built instance after all loaded instances have been built. E.g. can be used to cause a hash collection to hash all its initially collected entries after their instances have been built.- Specified by:
complete
in interfacePersistenceTypeHandler<D,T>
-
iterateMemberTypes
Description copied from interface:PersistenceTypeHandler
Iterates the types of persistent members (e.g. non-transientField
s). The same type may occur more than once. The order in which the types are provided is undefined, i.e. depending on the implementation.- Specified by:
iterateMemberTypes
in interfacePersistenceTypeHandler<D,T>
-
New
static <D, T> PersistenceUnreachableTypeHandler<D,T> New(PersistenceTypeDefinition typeDefinition)
-