|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.persistence.repository.OperationContext
public class OperationContext
This class permits to give details about operation actions (save action for now), especially the user who is the author of the operation. It is usually used from service method implementation. It is used by JPA Silverpeas API to set the technical entity informations on:
Method Summary | |
---|---|
void |
applyToPersistOperation(Entity entity)
Applying informations of the context to the given entity on a persist operation. |
void |
applyToUpdateOperation(Entity entity)
Applying informations of the context to the given entity on a update opearation. |
static OperationContext |
createInstance()
Creates an empty instance. |
static OperationContext |
fromUser(String userId)
Creates an instance from the given identifier which aims a user. |
static OperationContext |
fromUser(UserDetail user)
Creates an instance from the given user. |
static OperationContext |
getFromCache()
Get the current instance of the transaction from a cache (thread cache (request cache exactly)). |
UserDetail |
getUser()
Gets the user behind the operation. |
boolean |
isUpdatingInCaseOfCreation()
Indicates if the date update is performed in a case of creation. |
void |
putIntoCache()
Put the current instance into a cache (thread cache (request cache exactly)) to be retrieved from @PrePersist or @PreUpdate operations. |
OperationContext |
setUpdatingInCaseOfCreation()
Calling this method to indicates that the current data update is performed in a case of a creation. |
OperationContext |
setUpdatingInCaseOfCreation(boolean updatingInCaseOfCreation)
Calling this method to indicates that the current data update is performed in a case of a creation or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static OperationContext createInstance()
public static OperationContext fromUser(String userId)
userId
-
public static OperationContext fromUser(UserDetail user)
user
-
public static OperationContext getFromCache()
public OperationContext setUpdatingInCaseOfCreation()
public OperationContext setUpdatingInCaseOfCreation(boolean updatingInCaseOfCreation)
updatingInCaseOfCreation
- true to specify that the update is performed in a case of data
creation.public boolean isUpdatingInCaseOfCreation()
public UserDetail getUser()
public void putIntoCache()
public void applyToPersistOperation(Entity entity)
entity
- public void applyToUpdateOperation(Entity entity)
entity
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |