Package cz.cvut.kbss.jopa.sessions
Class ChangeTrackingUnitOfWork
java.lang.Object
cz.cvut.kbss.jopa.sessions.AbstractSession
cz.cvut.kbss.jopa.sessions.AbstractUnitOfWork
cz.cvut.kbss.jopa.sessions.ChangeTrackingUnitOfWork
- All Implemented Interfaces:
ConfigurationHolder,MetamodelProvider,UnitOfWork,Wrapper
-
Field Summary
Fields inherited from class cz.cvut.kbss.jopa.sessions.AbstractUnitOfWork
LOGFields inherited from class cz.cvut.kbss.jopa.sessions.AbstractSession
configuration -
Constructor Summary
ConstructorsConstructorDescriptionChangeTrackingUnitOfWork(AbstractSession parent, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionvoidattributeChanged(Object entity, FieldSpecification<?, ?> fieldSpec) Persists changed value of the specified field.voidattributeChanged(Object entity, Field f) Persists changed value of the specified field.createIndirectCollection(Object collection, Object owner, Field field) Creates an indirect collection, which wraps the specified collection instance and propagates changes to the persistence context.protected voidprotected <T> TreadObjectInternal(Class<T> cls, Object identifier, Descriptor descriptor) voidregisterNewObject(Object entity, Descriptor descriptor) Registers the specified new object in this Unit of Work.voidremoveObject(Object entity) Remove the given object from the repository.voidunregisterObject(Object object) Detaches the specified registered object from this Unit of Work.Methods inherited from class cz.cvut.kbss.jopa.sessions.AbstractUnitOfWork
acquireConnection, begin, clear, commit, contains, copyChangeSet, entityType, evictAfterMerge, getCloneForOriginal, getContexts, getCriteriaBuilder, getFieldDescriptor, getInstanceForMerge, getLiveObjectCache, getLoadStateRegistry, getManagedOriginal, getMetamodel, getOriginal, getReference, getState, getState, hasChanges, isActive, isConsistent, isEntityType, isFlushingChanges, isInferred, isInRepository, isInTransaction, isLoaded, isLoaded, isObjectManaged, isObjectNew, isReadOnly, loadEntityField, markCloneForDeletion, mergeDetached, processInferredValueChanges, putObjectIntoCache, readObject, readObjectFromAxioms, readObjectWithoutRegistration, refreshObject, registerExistingObject, registerExistingObject, registerOriginalForNewClone, release, removeIndirectWrappersAndProxies, removeObjectFromCache, restoreRemovedObject, rollback, sparqlQueryFactory, stringify, unregisterEntityFromOntologyContext, unwrap, writeUncommittedChangesMethods inherited from class cz.cvut.kbss.jopa.sessions.AbstractSession
getConfigurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cz.cvut.kbss.jopa.sessions.ConfigurationHolder
getConfigurationMethods inherited from interface cz.cvut.kbss.jopa.sessions.MetamodelProvider
getNamedQueryManager, getResultSetMappingManager
-
Constructor Details
-
ChangeTrackingUnitOfWork
-
-
Method Details
-
readObjectInternal
- Overrides:
readObjectInternalin classAbstractUnitOfWork
-
createIndirectCollection
Creates an indirect collection, which wraps the specified collection instance and propagates changes to the persistence context.- Parameters:
collection- Collection to be proxiedowner- Collection owner instancefield- Field filled with the collection- Returns:
- Indirect collection
-
detachAllManagedInstances
protected void detachAllManagedInstances() -
attributeChanged
Description copied from interface:UnitOfWorkPersists changed value of the specified field.- Parameters:
entity- Entity with changes (the clone)f- The field whose value has changed- See Also:
-
attributeChanged
Description copied from interface:UnitOfWorkPersists changed value of the specified field.- Parameters:
entity- Entity with changes (the clone)fieldSpec- Metamodel element representing the attribute that changed
-
registerNewObject
Description copied from interface:UnitOfWorkRegisters the specified new object in this Unit of Work.The object will be persisted into the context specified by
descriptor.- Specified by:
registerNewObjectin interfaceUnitOfWork- Overrides:
registerNewObjectin classAbstractUnitOfWork- Parameters:
entity- The object to registerdescriptor- Entity descriptor
-
unregisterObject
Description copied from interface:UnitOfWorkDetaches the specified registered object from this Unit of Work.- Specified by:
unregisterObjectin interfaceUnitOfWork- Overrides:
unregisterObjectin classAbstractUnitOfWork- Parameters:
object- Clone to detach
-
removeObject
Description copied from interface:UnitOfWorkRemove the given object from the repository.- Parameters:
entity- Object to remove
-