public class SaveContext
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.List<AccessConstraint<?>> |
accessConstraints |
protected boolean |
discardSaved |
protected java.util.Collection<java.lang.Object> |
entitiesToRemove |
protected java.util.Collection<java.lang.Object> |
entitiesToSave |
protected java.util.Map<java.lang.Object,FetchPlan> |
fetchPlans |
protected java.util.Map<java.lang.String,java.io.Serializable> |
hints |
protected boolean |
joinTransaction |
protected boolean |
softDeletion |
Constructor and Description |
---|
SaveContext() |
Modifier and Type | Method and Description |
---|---|
java.util.List<AccessConstraint<?>> |
getAccessConstraints() |
java.util.Collection<java.lang.Object> |
getEntitiesToRemove() |
java.util.Collection<java.lang.Object> |
getEntitiesToSave() |
java.util.Map<java.lang.Object,FetchPlan> |
getFetchPlans()
Enables defining a fetchPlan for each committed entity.
|
java.util.Map<java.lang.String,java.io.Serializable> |
getHints() |
boolean |
isDiscardSaved() |
boolean |
isJoinTransaction() |
SaveContext |
removing(java.lang.Object... entities)
Adds an entity to be removed from the database.
|
SaveContext |
saving(java.lang.Object... entities)
/**
Adds an entity to be committed to the database.
|
SaveContext |
saving(java.lang.Object entity,
FetchPlan fetchPlan)
Adds an entity to be committed to the database.
|
SaveContext |
setAccessConstraints(java.util.List<AccessConstraint<?>> accessConstraints) |
SaveContext |
setDiscardSaved(boolean discardSaved)
Set to true if calling code does not need saved instances, which allows for performance optimization.
|
SaveContext |
setHint(java.lang.String hintName,
java.io.Serializable value)
Sets custom hint that should be used by the query.
|
SaveContext |
setHints(java.util.Map<java.lang.String,java.io.Serializable> hints)
Sets custom hints that should be used by the query.
|
SaveContext |
setJoinTransaction(boolean joinTransaction) |
protected java.util.Collection<java.lang.Object> entitiesToSave
protected java.util.Collection<java.lang.Object> entitiesToRemove
protected java.util.Map<java.lang.Object,FetchPlan> fetchPlans
protected boolean softDeletion
protected boolean discardSaved
protected boolean joinTransaction
protected java.util.List<AccessConstraint<?>> accessConstraints
protected java.util.Map<java.lang.String,java.io.Serializable> hints
public SaveContext saving(java.lang.Object... entities)
entities
- entity instancespublic SaveContext saving(java.lang.Object entity, @Nullable FetchPlan fetchPlan)
entity
- entity instancefetchPlan
- fetch plan which is used in merge operation to ensure all required attributes are loaded in the returned instancepublic SaveContext removing(java.lang.Object... entities)
entities
- entity instancespublic java.util.Collection<java.lang.Object> getEntitiesToSave()
public java.util.Collection<java.lang.Object> getEntitiesToRemove()
public java.util.Map<java.lang.Object,FetchPlan> getFetchPlans()
public java.util.Map<java.lang.String,java.io.Serializable> getHints()
public SaveContext setHint(java.lang.String hintName, java.io.Serializable value)
public SaveContext setHints(java.util.Map<java.lang.String,java.io.Serializable> hints)
public boolean isDiscardSaved()
public SaveContext setDiscardSaved(boolean discardSaved)
public java.util.List<AccessConstraint<?>> getAccessConstraints()
public SaveContext setAccessConstraints(java.util.List<AccessConstraint<?>> accessConstraints)
public boolean isJoinTransaction()
public SaveContext setJoinTransaction(boolean joinTransaction)