@groovy.transform.Trait @groovy.transform.CompileStatic trait RxEntity<D> extends java.lang.Object implements DirtyCheckable, GormValidateable, RxGormOperations<D>, java.io.Serializable
Represents a reactive GORM entity
D
- The entity typeType Params | Return Type | Name and description |
---|---|---|
|
D |
addTo(java.lang.String associationName, java.lang.Object arg) Adds the given value to given association ensuring both sides are correctly associated |
|
static rx.Observable<java.lang.Number> |
count()
|
|
static D |
create()
|
|
static CriteriaBuilder<D> |
createCriteria() Creates a criteria builder instance |
|
private RxGormInstanceApi<D> |
currentRxGormInstanceApi() |
|
private static RxGormStaticApi<D> |
currentRxGormStaticApi() |
|
rx.Observable<java.lang.Boolean> |
delete(java.util.Map arguments) Deletes an entity |
|
static rx.Observable<java.lang.Number> |
deleteAll(D[] objects) Batch deletes a number of objects in one go |
|
static rx.Observable<java.lang.Number> |
deleteAll(java.lang.Iterable<D> objects) Batch deletes a number of objects in one go |
|
private rx.Observable<D> |
doSave(java.util.Map arguments, boolean isInsert) |
|
static rx.Observable<java.lang.Boolean> |
exists(java.io.Serializable id) Check whether an entity exists for the given id |
|
static rx.Observable<D> |
find(groovy.lang.Closure callable) Uses detached criteria to build a query and then execute it returning an observable |
|
static rx.Observable<D> |
findAll() List all entities and return an observable |
|
static rx.Observable<D> |
findAll(java.util.Map args) List all entities and return an observable |
|
static rx.Observable<D> |
findAll(groovy.lang.Closure callable) Uses detached criteria to build a query and then execute it returning an observable |
|
static rx.Observable<D> |
findAllWhere(java.util.Map queryMap) Finds all results matching all of the given conditions. |
|
static rx.Observable<D> |
findAllWhere(java.util.Map queryMap, java.util.Map args) Finds all results matching all of the given conditions. |
|
static rx.Observable<D> |
findOrCreateWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static rx.Observable<D> |
findOrSaveWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static rx.Observable<D> |
findWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static rx.Observable<D> |
findWhere(java.util.Map queryMap, java.util.Map args) Finds a single result matching all of the given conditions. |
|
static rx.Observable<D> |
first() Finds the first object using the natural sort order |
|
static rx.Observable<D> |
first(java.lang.String propertyName) Finds the first object sorted by propertyName |
|
static rx.Observable<D> |
first(java.util.Map queryParams) Finds the first object. |
|
static rx.Observable<D> |
get(java.io.Serializable id, java.util.Map args) Retrieve an instance by id |
|
java.io.Serializable |
getAssociationId(java.lang.String associationName) Obtains the id of an association without initialising the association |
|
static java.util.List<FinderMethod> |
getGormDynamicFinders()
|
|
static PersistentEntity |
getGormPersistentEntity() |
|
java.io.Serializable |
ident() Returns the objects identifier |
|
rx.Observable<D> |
insert(java.util.Map arguments) |
|
static rx.Observable<java.util.List<java.io.Serializable>> |
insertAll(java.lang.Iterable<D> objects, java.util.Map arguments) Batch saves all of the given objects |
|
static rx.Observable<java.util.List<java.io.Serializable>> |
insertAll(D[] objects) Batch saves all of the given objects |
|
boolean |
isDirty(java.lang.String fieldName) Checks whether a field is dirty |
|
boolean |
isDirty() Checks whether an entity is dirty |
|
static rx.Observable<D> |
last() Finds the last object using the natural sort order |
|
static rx.Observable<D> |
last(java.lang.String propertyName) Finds the last object sorted by propertyName |
|
static rx.Observable<D> |
last(java.util.Map<java.lang.String, java.lang.Object> params) Finds the last object. |
|
static rx.Observable<java.util.List<D>> |
list() List all entities and return an observable |
|
static rx.Observable<java.util.List<D>> |
list(java.util.Map args) List all entities and return an observable |
|
static ObservableProxy<D> |
proxy(java.io.Serializable id, java.util.Map args) Obtain a proxy to the given instance |
|
static ObservableProxy<D> |
proxy(DetachedCriteria<D> query, java.util.Map args) Obtain a proxy to the given instance |
|
D |
removeFrom(java.lang.String associationName, java.lang.Object arg) Removes the given value to given association ensuring both sides are correctly disassociated |
|
rx.Observable<D> |
save() Save an instance and return an observable |
|
rx.Observable<D> |
save(java.util.Map arguments) Save an instance and return an observable |
|
static rx.Observable<java.util.List<java.io.Serializable>> |
saveAll(java.lang.Iterable<D> objects, java.util.Map arguments) Batch saves all of the given objects |
|
static rx.Observable<java.util.List<java.io.Serializable>> |
saveAll(D[] objects) Batch saves all of the given objects |
|
static rx.Observable<D> |
staticMethodMissing(java.lang.String methodName, java.lang.Object arg) Handles dynamic finders |
|
static java.lang.Object |
staticPropertyMissing(java.lang.String property) |
|
boolean |
validate(java.util.Map arguments) |
|
boolean |
validate(java.util.List fields) |
|
boolean |
validate() |
|
static DetachedCriteria<D> |
where(groovy.lang.Closure callable)
|
|
static DetachedCriteria<D> |
whereAny(groovy.lang.Closure callable)
|
|
static DetachedCriteria<D> |
whereLazy(groovy.lang.Closure callable)
|
|
RxGormAllOperations<D> |
withConnection(java.lang.String connectionName) Perform operations with the given connection |
<T> |
static T |
withConnection(java.lang.String connectionName, groovy.lang.Closure<T> callable) Switches to given named connection within the context of the closure. |
|
static rx.Observable |
withCriteria(groovy.lang.Closure callable) Creates a criteria builder instance |
|
static rx.Observable |
withCriteria(java.util.Map builderArgs, groovy.lang.Closure callable) Creates a criteria builder instance |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Adds the given value to given association ensuring both sides are correctly associated
associationName
- The association namearg
- The value
Creates a criteria builder instance
Deletes an entity
Batch deletes a number of objects in one go
objects
- The objects to deleteBatch deletes a number of objects in one go
objects
- The objects to deleteCheck whether an entity exists for the given id @return
Uses detached criteria to build a query and then execute it returning an observable
callable
- The callableList all entities and return an observable
List all entities and return an observable
Uses detached criteria to build a query and then execute it returning an observable
callable
- The callableFinds all results matching all of the given conditions. Eg. Book.findAllWhere(author:"Stephen King", title:"The Stand")
queryMap
- The map of conditionsFinds all results matching all of the given conditions. Eg. Book.findAllWhere(author:"Stephen King", title:"The Stand")
queryMap
- The map of conditionsargs
- The Query argumentsFinds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand"). If a matching persistent entity is not found a new entity is created and returned.
queryMap
- The map of conditionsFinds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand"). If a matching persistent entity is not found a new entity is created, saved and returned.
queryMap
- The map of conditionsFinds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand")
queryMap
- The map of conditionsFinds a single result matching all of the given conditions. Eg. Book.findWhere(author:"Stephen King", title:"The Stand")
queryMap
- The map of conditionsargs
- The Query argumentsFinds the first object using the natural sort order
Finds the first object sorted by propertyName
propertyName
- the name of the property to sort byFinds the first object. If queryParams includes 'sort', that will dictate the sort order, otherwise natural sort order will be used. queryParams may include any of the same parameters that might be passed to the list(Map) method. This method will ignore 'order' and 'max' as those are always 'asc' and 1, respectively.
Retrieve an instance by id
id
- The id of the instanceObtains the id of an association without initialising the association
associationName
- The association name
Returns the objects identifier
Batch saves all of the given objects
objects
- The objects to saveBatch saves all of the given objects
objects
- The objects to saveChecks whether a field is dirty
instance
- The instancefieldName
- The name of the fieldChecks whether an entity is dirty
instance
- The instanceFinds the last object using the natural sort order
Finds the last object sorted by propertyName
propertyName
- the name of the property to sort byFinds the last object. If queryParams includes 'sort', that will dictate the sort order, otherwise natural sort order will be used. queryParams may include any of the same parameters that might be passed to the list(Map) method. This method will ignore 'order' and 'max' as those are always 'desc' and 1, respectively.
List all entities and return an observable
List all entities and return an observable
Obtain a proxy to the given instance
id
- The id of the instanceObtain a proxy to the given instance
query
- The query that returns the instanceRemoves the given value to given association ensuring both sides are correctly disassociated
associationName
- The association namearg
- The valueSave an instance and return an observable
Save an instance and return an observable
Batch saves all of the given objects
objects
- The objects to saveBatch saves all of the given objects
objects
- The objects to saveHandles dynamic finders
methodName
- The method namearg
- The argument to the method
callable
- Callable closure containing detached criteria definition
callable
- Callable closure containing detached criteria definition
callable
- Callable closure containing detached criteria definitionPerform operations with the given connection
connectionName
- The name of the connectionSwitches to given named connection within the context of the closure. The delegate of the closure is used to resolve operations against the connection. @return
connectionName
- The name of the connectioncallable
- The closureCreates a criteria builder instance
Creates a criteria builder instance