@groovy.transform.CompileStatic trait RxEntity
Represents a reactive GORM entity
- 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 java.util.Observable<java.lang.Number> |
count() @return Counts the number of instances |
|
static D |
create() @return A new instance of this RxEntity |
|
static CriteriaBuilder<D> |
createCriteria() Creates a criteria builder instance |
|
java.util.Observable<java.lang.Boolean> |
delete(java.util.Map arguments = Collections.emptyMap() Deletes an entity |
|
static java.util.Observable<java.lang.Number> |
deleteAll(D... objects) Batch deletes a number of objects in one go |
|
static java.util.Observable<java.lang.Number> |
deleteAll(java.lang.Iterable<D> objects) Batch deletes a number of objects in one go |
|
static java.util.Observable<java.lang.Boolean> |
exists(java.io.Serializable id) Check whether an entity exists for the given id |
|
static java.util.Observable<D> |
find(groovy.lang.Closure callable) Uses detached criteria to build a query and then execute it returning an observable |
|
static java.util.Observable<D> |
findAll() List all entities and return an observable |
|
static java.util.Observable<D> |
findAll(java.util.Map args) List all entities and return an observable |
|
static java.util.Observable<D> |
findAll(groovy.lang.Closure callable) Uses detached criteria to build a query and then execute it returning an observable |
|
static java.util.Observable<D> |
findAllWhere(java.util.Map queryMap) Finds all results matching all of the given conditions. |
|
static java.util.Observable<D> |
findAllWhere(java.util.Map queryMap, java.util.Map args) Finds all results matching all of the given conditions. |
|
static java.util.Observable<D> |
findOrCreateWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static java.util.Observable<D> |
findOrSaveWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static java.util.Observable<D> |
findWhere(java.util.Map queryMap) Finds a single result matching all of the given conditions. |
|
static java.util.Observable<D> |
findWhere(java.util.Map queryMap, java.util.Map args) Finds a single result matching all of the given conditions. |
|
static java.util.Observable<D> |
first() Finds the first object using the natural sort order |
|
static java.util.Observable<D> |
first(java.lang.String propertyName) Finds the first object sorted by propertyName |
|
static java.util.Observable<D> |
first(java.util.Map queryParams) Finds the first object. |
|
static java.util.Observable<D> |
get(java.io.Serializable id, java.util.Map args = Collections.emptyMap() 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() @return The dynamic finders for this domain class |
|
static PersistentEntity |
getGormPersistentEntity() |
|
java.io.Serializable |
ident() Returns the objects identifier |
|
java.util.Observable<D> |
insert(java.util.Map arguments = Collections.emptyMap() |
|
static java.util.Observable<java.util.List<java.io.Serializable>> |
insertAll(java.lang.Iterable<D> objects, java.util.Map arguments = Collections.emptyMap() Batch saves all of the given objects |
|
static java.util.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 java.util.Observable<D> |
last() Finds the last object using the natural sort order |
|
static java.util.Observable<D> |
last(java.lang.String propertyName) Finds the last object sorted by propertyName |
|
static java.util.Observable<D> |
last(java.util.Map<java.lang.String, java.lang.Object> params) Finds the last object. |
|
static java.util.Observable<java.util.List<D>> |
list() List all entities and return an observable |
|
static java.util.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 = Collections.emptyMap() Obtain a proxy to the given instance |
|
static ObservableProxy<D> |
proxy(DetachedCriteria<D> query, java.util.Map args = Collections.emptyMap() 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 |
|
java.util.Observable<D> |
save() Save an instance and return an observable |
|
java.util.Observable<D> |
save(java.util.Map arguments) Save an instance and return an observable |
|
static java.util.Observable<java.util.List<java.io.Serializable>> |
saveAll(java.lang.Iterable<D> objects, java.util.Map arguments = Collections.emptyMap() Batch saves all of the given objects |
|
static java.util.Observable<java.util.List<java.io.Serializable>> |
saveAll(D... objects) Batch saves all of the given objects |
|
static java.util.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) @param callable Callable closure containing detached criteria definition |
|
static DetachedCriteria<D> |
whereAny(groovy.lang.Closure callable) @param callable Callable closure containing detached criteria definition |
|
static DetachedCriteria<D> |
whereLazy(groovy.lang.Closure callable) @param callable Callable closure containing detached criteria definition |
|
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 java.util.Observable |
withCriteria(groovy.lang.Closure callable) Creates a criteria builder instance |
|
static java.util.Observable |
withCriteria(java.util.Map builderArgs, groovy.lang.Closure callable) Creates a criteria builder instance |
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
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.
connectionName
- The name of the connectioncallable
- The closureCreates a criteria builder instance
Creates a criteria builder instance