public class CommitContext
extends java.lang.Object
implements java.io.Serializable
DataService
Constructor and Description |
---|
CommitContext(java.util.Collection commitInstances) |
CommitContext(java.util.Collection commitInstances,
java.util.Collection removeInstances) |
CommitContext(Entity... commitInstances) |
Modifier and Type | Method and Description |
---|---|
CommitContext |
addInstanceToCommit(Entity entity)
Adds an entity to be committed to the database.
|
CommitContext |
addInstanceToCommit(Entity entity,
java.lang.String viewName)
Adds an entity to be committed to the database.
|
CommitContext |
addInstanceToCommit(Entity entity,
View view)
Adds an entity to be committed to the database.
|
CommitContext |
addInstanceToRemove(Entity entity)
Adds an entity to be removed from the database.
|
java.util.Collection<Entity> |
getCommitInstances() |
java.util.Map<java.lang.String,java.lang.Object> |
getDbHints() |
java.util.Collection<Entity> |
getRemoveInstances() |
java.util.Map<java.lang.Object,View> |
getViews()
Enables defining a view for each committed entity.
|
boolean |
isAuthorizationRequired() |
boolean |
isDiscardCommitted() |
boolean |
isJoinTransaction() |
boolean |
isSoftDeletion() |
CommitContext |
setAuthorizationRequired(boolean authorizationRequired) |
void |
setCommitInstances(java.util.Collection commitInstances) |
void |
setDiscardCommitted(boolean discardCommitted)
Set to true if calling code does not need committed instances, which allows for performance optimization.
|
CommitContext |
setJoinTransaction(boolean joinTransaction) |
void |
setRemoveInstances(java.util.Collection removeInstances) |
void |
setSoftDeletion(boolean softDeletion) |
public CommitContext(Entity... commitInstances)
commitInstances
- changed entities to be committed to the databasepublic CommitContext(java.util.Collection commitInstances)
commitInstances
- collection of changed entities to be committed to the databasepublic CommitContext(java.util.Collection commitInstances, java.util.Collection removeInstances)
commitInstances
- collection of changed entities to be committed to the databaseremoveInstances
- collection of entities to be removed from the databasepublic CommitContext addInstanceToCommit(Entity entity)
entity
- entity instancepublic CommitContext addInstanceToCommit(Entity entity, @Nullable View view)
entity
- entity instanceview
- view which is used in merge operation to ensure all required attributes are loaded in the returned instancepublic CommitContext addInstanceToCommit(Entity entity, @Nullable java.lang.String viewName)
entity
- entity instanceviewName
- view which is used in merge operation to ensure all required attributes are loaded in the returned instancepublic CommitContext addInstanceToRemove(Entity entity)
entity
- entity instancepublic java.util.Collection<Entity> getCommitInstances()
public void setCommitInstances(java.util.Collection commitInstances)
commitInstances
- collection of changed entities that will be committed to the databasepublic java.util.Collection<Entity> getRemoveInstances()
public void setRemoveInstances(java.util.Collection removeInstances)
removeInstances
- collection of entities to be removed from the databasepublic java.util.Map<java.lang.Object,View> getViews()
public java.util.Map<java.lang.String,java.lang.Object> getDbHints()
public boolean isSoftDeletion()
public void setSoftDeletion(boolean softDeletion)
softDeletion
- whether to use soft deletion for this commitpublic boolean isDiscardCommitted()
public void setDiscardCommitted(boolean discardCommitted)
public boolean isAuthorizationRequired()
public CommitContext setAuthorizationRequired(boolean authorizationRequired)
public boolean isJoinTransaction()
public CommitContext setJoinTransaction(boolean joinTransaction)