public class HibernateImportProcessorContext extends BaseImportProcessorContext
Constructor and Description |
---|
HibernateImportProcessorContext(org.hibernate.engine.spi.SessionImplementor session,
org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory,
ProgressMeter meter,
boolean preserveIds,
ImportedObjectPreProcessor preProcessor,
Properties exportDescriptor) |
Modifier and Type | Method and Description |
---|---|
void |
addUnsatisfiedObjectDependencies(Set<ImportEntityHandle> unsatisfiedObjectDependencies,
ImportedObject importedObject)
Defer the saving of an object because it has referential dependencies on some objects that have not yet been
imported, but that can not be temporarily left null.
|
void |
deferOperations(Map<ImportEntityHandle,Set<Operation>> operations)
Deprecated.
since 5.2 Use
deferOperations(PrimitiveId, Map) |
void |
deferOperations(PrimitiveId idProperty,
Map<ImportEntityHandle,Set<Operation>> operations)
Defer a set of operations until the objects they require have been imported.
|
<T> Object |
generateNewIdFor(Class<T> clazz,
T object) |
protected <T> Serializable |
generateNewIdFor(Class<T> clazz,
T object,
Serializable idValue) |
org.hibernate.persister.entity.EntityPersister |
getEntityPersister(Class classToPersist)
Get the Hibernate class persister for a particular class.
|
Properties |
getExportDescriptor() |
protected Serializable |
getIdMapping(Object obj,
Serializable idValue,
Class clazz) |
org.hibernate.engine.spi.SessionImplementor |
getSession()
Gets the current Hibernate session.
|
boolean |
isPropertyNullable(Class classToPersist,
String propertyName) |
void |
objectImported(ImportEntityHandle handle)
Record that a particular object has been successfully persisted.
|
void |
reportIncompleteDefferredOperations()
Log any deferred operations that are still pending.
|
Object |
resolveHandle(ImportEntityHandle handle) |
void |
saveObject(Object object)
Save a particular object to the Hibernate session.
|
void |
saveObject(Serializable id,
Class classToPersist,
Object objectToPersist) |
addExplicitIdMapping, getContextVariable, getIdMappingFor, getImportedObjectHandlesOfType, getImportedObjectsOfType, getPendingDeferredImportedObjects, getPersistedMappedHandles, getPersistedUnmappedHandles, getPreProcessor, getUnfixedIdFor, hasPendingDeferredObject, isObjectAlreadyImported, isPreserveIds, lookupObjectByUnfixedHandle, nextPendingDeferredObject, polyMorphicLookupByUnfixedId, setContextVariable
public HibernateImportProcessorContext(org.hibernate.engine.spi.SessionImplementor session, org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory, ProgressMeter meter, boolean preserveIds, ImportedObjectPreProcessor preProcessor, Properties exportDescriptor)
public void objectImported(ImportEntityHandle handle) throws Exception
objectImported
in interface ImportProcessorContext
objectImported
in class BaseImportProcessorContext
handle
- the handle of the persisted object, before any ID mapping occurredException
- if some error occurred running the deferred operationspublic org.hibernate.persister.entity.EntityPersister getEntityPersister(Class classToPersist)
public void saveObject(Object object) throws ImportExportException
ImportExportException
public Object resolveHandle(ImportEntityHandle handle) throws ImportExportException
resolveHandle
in class BaseImportProcessorContext
ImportExportException
public org.hibernate.engine.spi.SessionImplementor getSession()
public void deferOperations(PrimitiveId idProperty, Map<ImportEntityHandle,Set<Operation>> operations)
deferOperations
in interface ImportProcessorContext
deferOperations
in class BaseImportProcessorContext
idProperty
- ID of the object on which the operations will be performed.operations
- a map between the handle of the object that is being waited on, and the set of operations
that should be executed once that object is imported.@Deprecated public void deferOperations(Map<ImportEntityHandle,Set<Operation>> operations)
deferOperations(PrimitiveId, Map)
operations
- a map between the handle of the object that is being waited on, and the set of operations
that should be executed once that object is imported.public void addUnsatisfiedObjectDependencies(Set<ImportEntityHandle> unsatisfiedObjectDependencies, ImportedObject importedObject)
BaseImportProcessorContext.nextPendingDeferredObject()
addUnsatisfiedObjectDependencies
in interface ImportProcessorContext
addUnsatisfiedObjectDependencies
in class BaseImportProcessorContext
unsatisfiedObjectDependencies
- importedObject
- BaseImportProcessorContext.nextPendingDeferredObject()
,
BaseImportProcessorContext.hasPendingDeferredObject()
public void saveObject(Serializable id, Class classToPersist, Object objectToPersist) throws ImportExportException
ImportExportException
public void reportIncompleteDefferredOperations() throws Exception
Exception
- there was some problem reporting the deferred operations (should not happen)protected Serializable getIdMapping(Object obj, Serializable idValue, Class clazz) throws ImportExportException
getIdMapping
in class BaseImportProcessorContext
ImportExportException
protected <T> Serializable generateNewIdFor(Class<T> clazz, T object, Serializable idValue) throws ImportExportException
generateNewIdFor
in class BaseImportProcessorContext
ImportExportException
public <T> Object generateNewIdFor(Class<T> clazz, T object) throws SQLException
SQLException
public Properties getExportDescriptor()
Copyright © 2003–2017 Atlassian. All rights reserved.