public class HibernateSaveProcessor extends SaveProcessor
SaveProcessor.SaveState
Constructor and Description |
---|
HibernateSaveProcessor(Metadata metadata,
org.hibernate.SessionFactory sessionFactory) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getIdentifier(java.lang.Object entity)
Used to return the id for an entity.
|
protected void |
processEntity(EntityInfo entityInfo)
Add, update, or delete the entity according to its EntityState.
|
void |
processRelationships(EntityInfo entityInfo,
boolean removeMode)
Called for each entity to attach of detach it from any related entities.
|
protected void |
processSaves(java.util.List<EntityInfo> saveOrder)
Persist the changes to the entities in the saveOrder.
|
protected void |
refreshFromSession(SaveWorkState saveWorkState)
Refresh the entities from the database.
|
protected void |
restoreOldVersionValue(EntityInfo entityInfo,
org.hibernate.metadata.ClassMetadata classMeta)
Restore the old value of the concurrency column so Hibernate will save the entity.
|
protected void |
saveChangesCore(SaveWorkState saveWorkState)
Persist the changes to the entities in the SaveWorkState that is passed in.
|
getMetadata, getSaveState, saveChanges, setSaveState
public HibernateSaveProcessor(Metadata metadata, org.hibernate.SessionFactory sessionFactory)
metadata
- sessionFactory
- protected void saveChangesCore(SaveWorkState saveWorkState)
saveChangesCore
in class SaveProcessor
saveWorkState
- public void processRelationships(EntityInfo entityInfo, boolean removeMode)
SaveProcessor
processRelationships
in class SaveProcessor
entityInfo
- The EntityInfo to attach or detach.removeMode
- Whether to detach.public java.lang.Object getIdentifier(java.lang.Object entity)
SaveProcessor
getIdentifier
in class SaveProcessor
entity
- The entity to return an identifier for.protected void processSaves(java.util.List<EntityInfo> saveOrder)
saveOrder
- protected void processEntity(EntityInfo entityInfo)
entityInfo
- classMeta
- protected void restoreOldVersionValue(EntityInfo entityInfo, org.hibernate.metadata.ClassMetadata classMeta)
entityInfo
- classMeta
- protected void refreshFromSession(SaveWorkState saveWorkState)
saveMap
-