public abstract class SaveProcessor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SaveProcessor.SaveState
Describes the current stage of processing for the entities within a SaveWorkState.
|
Modifier | Constructor and Description |
---|---|
protected |
SaveProcessor(Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.Object |
getIdentifier(java.lang.Object entity)
Used to return the id for an entity.
|
Metadata |
getMetadata() |
protected SaveProcessor.SaveState |
getSaveState() |
abstract void |
processRelationships(EntityInfo entityInfo,
boolean removeMode)
Called for each entity to attach of detach it from any related entities.
|
SaveResult |
saveChanges(SaveWorkState saveWorkState)
Persist the changes to the entities in the SaveWorkState that is passed in.
|
protected abstract void |
saveChangesCore(SaveWorkState saveWorkState)
Core method to save the changes to the database.
|
protected void |
setSaveState(SaveProcessor.SaveState saveState) |
protected SaveProcessor(Metadata metadata)
public SaveResult saveChanges(SaveWorkState saveWorkState)
saveWorkState
- A saveWorkState that consists of the entities to be saved and any
interceptors that should be called during the save process.public Metadata getMetadata()
protected SaveProcessor.SaveState getSaveState()
protected void setSaveState(SaveProcessor.SaveState saveState)
saveState
- SaveState to set.protected abstract void saveChangesCore(SaveWorkState saveWorkState)
public abstract void processRelationships(EntityInfo entityInfo, boolean removeMode)
entityInfo
- The EntityInfo to attach or detach.removeMode
- Whether to detach.public abstract java.lang.Object getIdentifier(java.lang.Object entity)
entity
- The entity to return an identifier for.