public interface _IQueryOperationsNC extends _ServiceInterfaceOperationsNC
IUpdate
interface, using other methods
will most likely not leave the database in an inconsistent state,
but may provide stale data in some situations.
By convention, all methods that begin with get
will
never return a null or empty Collection
, but
instead will throw a ValidationException
.Modifier and Type | Method and Description |
---|---|
void |
find_async(AMD_IQuery_find __cb,
java.lang.String klass,
long id)
Looks up an entity by class and id.
|
void |
findAll_async(AMD_IQuery_findAll __cb,
java.lang.String klass,
Filter filter)
Looks up all entities that belong to this class and match
filter.
|
void |
findAllByExample_async(AMD_IQuery_findAllByExample __cb,
IObject example,
Filter filter)
Searches based on provided example entity.
|
void |
findAllByFullText_async(AMD_IQuery_findAllByFullText __cb,
java.lang.String klass,
java.lang.String query,
Parameters params)
Executes a full text search based on Lucene.
|
void |
findAllByQuery_async(AMD_IQuery_findAllByQuery __cb,
java.lang.String query,
Parameters params)
Executes the stored query with the given name.
|
void |
findAllByString_async(AMD_IQuery_findAllByString __cb,
java.lang.String klass,
java.lang.String field,
java.lang.String value,
boolean caseSensitive,
Filter filter)
Searches a given field matching against a String.
|
void |
findByExample_async(AMD_IQuery_findByExample __cb,
IObject example)
Searches based on provided example entity.
|
void |
findByQuery_async(AMD_IQuery_findByQuery __cb,
java.lang.String query,
Parameters params)
Executes the stored query with the given name.
|
void |
findByString_async(AMD_IQuery_findByString __cb,
java.lang.String klass,
java.lang.String field,
java.lang.String value)
Searches a given field matching against a String.
|
void |
get_async(AMD_IQuery_get __cb,
java.lang.String klass,
long id)
Looks up an entity by class and id.
|
void |
projection_async(AMD_IQuery_projection __cb,
java.lang.String query,
Parameters params)
Return a sequence of
RType sequences. |
void |
refresh_async(AMD_IQuery_refresh __cb,
IObject iObject)
Refreshes an entire
IObject graph,
recursive loading all data for the managed instances in the
graph from the database. |
void get_async(AMD_IQuery_get __cb, java.lang.String klass, long id) throws ServerError
__cb
- The callback object for the operation.klass
- the type of the entity. Not null.ValidationException
- if the id doesn't exist.ServerError
void find_async(AMD_IQuery_find __cb, java.lang.String klass, long id) throws ServerError
null
.__cb
- The callback object for the operation.klass
- klass the type of the entity. Not null.ServerError
void findAll_async(AMD_IQuery_findAll __cb, java.lang.String klass, Filter filter) throws ServerError
__cb
- The callback object for the operation.klass
- entity type to be searched. Not null.ServerError
void findByExample_async(AMD_IQuery_findByExample __cb, IObject example) throws ServerError
id
field. For that, use find
, get
,
findByQuery
, or findAllByQuery
.__cb
- The callback object for the operation.example
- Non-null example object.ApiUsageException
- if more than one result is return.ServerError
void findAllByExample_async(AMD_IQuery_findAllByExample __cb, IObject example, Filter filter) throws ServerError
Filter
object.
Note: findAllbyExample does not operate on the
id
field.
For that, use find
, get
,
findByQuery
, or findAllByQuery
.__cb
- The callback object for the operation.example
- Non-null example object.ServerError
void findByString_async(AMD_IQuery_findByString __cb, java.lang.String klass, java.lang.String field, java.lang.String value) throws ServerError
__cb
- The callback object for the operation.klass
- type of entity to be searchedvalue
- String used for search.ome.conditions.ApiUsageException
- if more than one result.ServerError
void findAllByString_async(AMD_IQuery_findAllByString __cb, java.lang.String klass, java.lang.String field, java.lang.String value, boolean caseSensitive, Filter filter) throws ServerError
Filter
instance.__cb
- The callback object for the operation.klass
- type of entity to be searched. Not null.value
- String used for search. Not null.filter
- filters the result set. Can be null.ServerError
void findByQuery_async(AMD_IQuery_findByQuery __cb, java.lang.String query, Parameters params) throws ServerError
__cb
- The callback object for the operation.query
- Query to executeValidationException
ServerError
void findAllByQuery_async(AMD_IQuery_findAllByQuery __cb, java.lang.String query, Parameters params) throws ServerError
IObject
instances. This means
all must be of the form:
select this from SomeModelClass this ...though the alias this is unimportant. Do not try to return multiple classes in one call like:
select this, that from SomeClass this, SomeOtherClass that ...nor to project values out of an object:
select this.name from SomeClass this ...If a page is desired, add it to the query parameters.
__cb
- The callback object for the operation.query
- Query to execute. Not null.ServerError
void findAllByFullText_async(AMD_IQuery_findAllByFullText __cb, java.lang.String klass, java.lang.String query, Parameters params) throws ServerError
__cb
- The callback object for the operation.klass
- A non-null class specification of which type
should be searched.query
- A non-null query string. An empty string will
return no results.params
- Currently the parameters themselves are unused.
But the Parameters.theFilter
can be used to limit the number of results
returned (Filter.limit
) or the
user for who the results will be found
(Filter.ownerId
).ServerError
void projection_async(AMD_IQuery_projection __cb, java.lang.String query, Parameters params) throws ServerError
RType
sequences.
Each element of the outer sequence is one row in the return value. Each element of the inner sequence is one column specified in the HQL.
IObject
instances are returned wrapped
in an RObject
instance. Primitives are
mapped to the expected RType
subclass. Types
without an RType
mapper if returned will
throw an exception if present in the select except where a
manual conversion is present on the server. This includes:
Permissions
instances are
serialized to an RMap
containing the
keys: perms, canAnnotate, canEdit, canLink, canDelete,
canChgrp, canChown
Length
are
serialized to an RMap
containing the
keys: value, unit, symbol
As with SQL, if an aggregation statement is used, a group by clause must be added.
Examples:
select i.name, i.description from Image i where i.name like '%.dv' select tag.textValue, tagset.textValue from TagAnnotation tag join tag.annotationLinks l join l.child tagset select p.pixelsType.value, count(p.id) from Pixel p group by p.pixelsType.value
__cb
- The callback object for the operation.ServerError
void refresh_async(AMD_IQuery_refresh __cb, IObject iObject) throws ServerError
IObject
graph,
recursive loading all data for the managed instances in the
graph from the database. If any non-managed entities are
detected (e.g. without ids), an
ApiUsageException
will be thrown.__cb
- The callback object for the operation.iObject
- Non-null managed IObject
graph which should have all values
re-assigned from the databaseApiUsageException
- if any non-managed entities are
found.ServerError