public interface ScriptHelper
| Modifier and Type | Method and Description |
|---|---|
void |
addOnCommit(java.lang.Runnable runnable)
Adds a listener to be executed when the main transaction commits, which is not executed in a database transaction
|
void |
addOnCommitTransactional(java.lang.Runnable runnable)
Adds a listener to be executed when the main transaction commits, which is executed inside a new transaction
|
void |
addOnRollback(java.lang.Runnable runnable)
Adds a listener to be executed when the main transaction rollbacks, which is not executed in a database
transaction
|
void |
addOnRollbackTransactional(java.lang.Runnable runnable)
Adds a listener to be executed when the main transaction is rolled-back, which is executed inside a new
transaction
|
<T> T |
bean(java.lang.Class<T> beanType)
Returns a bean by type
|
java.lang.Object |
bean(java.lang.String name)
Returns a bean by short name.
|
org.springframework.context.ApplicationContext |
getApplicationContext()
Returns the Spring application context
|
java.util.Map<java.lang.String,java.lang.Object> |
getBeanMap()
Returns a Map with all beans accessible by
bean(String) |
java.lang.Long |
maskId(java.lang.Object id)
Returns a value suitable to be sent to clients, which represents the given entity identifier
|
java.lang.Long |
unmaskId(java.lang.Object id)
Returns a value suitable to be used on server side, given the argument is a masked identifier
|
java.util.Map<java.lang.String,java.lang.Object> |
wrap(java.lang.Object object)
Wraps an object in a
Map, providing access to object properties as map keys. |
java.util.Map<java.lang.String,java.lang.Object> |
wrap(java.lang.Object object,
java.util.Collection<? extends CustomField<?,?,?>> customFields)
Same as
wrap(Object), but providing an explicit custom fields collection, instead of trying to get from
the object. |
void addOnCommit(java.lang.Runnable runnable)
void addOnCommitTransactional(java.lang.Runnable runnable)
void addOnRollback(java.lang.Runnable runnable)
void addOnRollbackTransactional(java.lang.Runnable runnable)
<T> T bean(java.lang.Class<T> beanType)
java.lang.Object bean(java.lang.String name)
UserServiceLocal, invokerHandler
returns InvokerHandler and so on.org.springframework.context.ApplicationContext getApplicationContext()
java.util.Map<java.lang.String,java.lang.Object> getBeanMap()
bean(String)java.lang.Long maskId(java.lang.Object id)
java.lang.Long unmaskId(java.lang.Object id)
java.util.Map<java.lang.String,java.lang.Object> wrap(java.lang.Object object)
Map, providing access to object properties as map keys. For objects with custom
fields
(that implement either ModelWithCustomValues or EntityWithCustomValues),
custom fields can be accessed via the field internal name.
So, for example, for an user, user.gender would return the CustomFieldPossibleValue, assuming it is an
enumerated custom field.java.util.Map<java.lang.String,java.lang.Object> wrap(java.lang.Object object,
java.util.Collection<? extends CustomField<?,?,?>> customFields)
wrap(Object), but providing an explicit custom fields collection, instead of trying to get from
the object. Is useful, for
example, when creating a new entity / DTO, when it doesn't yet have a list of custom values