A complete interface for the Repository.
Type Params | Return Type | Name and description |
---|---|---|
|
void |
batchCreate(Map args, List<Map> batch) |
|
void |
batchCreate(List<Map> batch) |
|
void |
batchPersist(Map args, List<D> list) |
|
void |
batchPersist(List<D> list) |
|
void |
batchRemove(Map args, List batch) |
|
void |
batchRemove(List batch) |
|
void |
batchUpdate(Map args, List<Map> batch) |
|
void |
batchUpdate(List<Map> batch) |
|
void |
bind(Map args, D entity, Map data, BindAction bindAction) binds by calling doBind and fires before and after events better to override doBind in implementing classes for custom logic. |
|
D |
create(Map data) Transactional wrap for doCreate |
|
D |
create(Map args, Map data) |
|
void |
doBind(Map args, D entity, Map data, BindAction bindAction) Main bind method that redirects call to the injected mapBinder. see getMapBinder override this one in implementing classes. can also call this if you don't want events to fire |
|
D |
doCreate(Map args, Map data) Creates entity using the data from params. calls the bind with BindAction.Create |
|
D |
doPersist(Map args, D entity) saves a domain entity with the passed in args. |
|
void |
doRemove(Map args, D entity) |
|
void |
doRemove(D entity) |
|
D |
doUpdate(Map args, Map data) Updates entity using the data from params. calls the bind with BindAction.Update |
|
D |
get(Serializable id, Long version) gets and verifies that the entity can be retrieved and version matches. |
|
D |
get(Map params) This default will redirect the call to get(Serializable id, Long version). |
|
Boolean |
getEnableEvents() default to true. |
|
Class<D> |
getEntityClass() The java class for the Gorm domain (persistence entity). will generally get set in constructor or using the generic as done in GormRepo.getEntityClass using the GenericTypeResolver |
|
MapBinder |
getMapBinder() The data binder to use. |
|
RuntimeException |
handleException(RuntimeException e, D entity) |
|
D |
persist(Map args, D entity) Transactional wrap for doPersist with arguments to pass to save |
|
D |
persist(D entity) Transactional wrap for doPersist |
|
void |
remove(D entity) Wrappep in Trx. |
|
void |
remove(Map args, D entity) |
|
void |
removeById(Map args, Serializable id) Remove by ID. |
|
void |
removeById(Serializable id) |
|
D |
update(Map data) Transactional wrap for doUpdate |
|
D |
update(Map args, Map data) |
binds by calling doBind and fires before and after events better to override doBind in implementing classes for custom logic. Or just implement the beforeBind|afterBind event methods
Main bind method that redirects call to the injected mapBinder. see getMapBinder override this one in implementing classes. can also call this if you don't want events to fire
Creates entity using the data from params. calls the bind with BindAction.Create
data
- the data to bind onto the entitysaves a domain entity with the passed in args. If a ValidationException is caught it wraps and throws it with our DataValidationException.
entity
- the domain entity to call save onargs
- the arguments to pass to saveUpdates entity using the data from params. calls the bind with BindAction.Update
data
- the data to bind onto the entitygets and verifies that the entity can be retrieved and version matches.
id
- required, the id to getversion
- - can be null. if its passed in then it validates its that same as the version in the retrieved entity.This default will redirect the call to get(Serializable id, Long version). Implementing classes can override this and add custom finders using another unique lookup key other than id, such as customer number or invoice number. Unlike the normal get(id) This throws a EntityNotFoundException if nothing is found instead of returning a null.
args
- - name params expects at least and [id] key and optionally a version,
implementation classes can customize to work with more.default to true. If false only method events are invoked on the implemented Repository.
The java class for the Gorm domain (persistence entity). will generally get set in constructor or using the generic as done in GormRepo.getEntityClass using the GenericTypeResolver
The data binder to use. By default gets injected with EntityMapBinder
Transactional wrap for doPersist
Wrappep in Trx. Calls doRemove.
entity
- the domain entityRemove by ID. Wrapping this in a Transaction in an implementing class here is optional
id
- - the id for theargs
- - the args to pass to delete. can be null and [flush] being the most common