|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.garret.jsql.Query
Class representing JSQL query.
Constructor Summary | |
Query()
|
Method Summary | |
boolean |
add(java.lang.Object obj)
Add object to the selection. |
static java.lang.Object |
castLiteral(java.lang.Class type,
java.lang.Object value)
Cast literal to the stpecified type. |
void |
enableRuntimeErrorReporting(boolean enabled)
Enable or disable reporting of runtime errors By default it is enabled. |
java.lang.Object[] |
execute(QueryIterator iterator)
Execute prepared query |
java.lang.Object[] |
execute(QueryIterator iterator,
int limit)
Execute prepared query |
java.lang.Object[] |
execute(QueryIterator iterator,
int limit,
int nThreads)
Execute prepared query |
static java.lang.Object |
normalizeKeyValue(java.lang.Object value)
Convert key value to the form used by JSQL to make it possible to compare it with JSQL expression value. |
void |
prepare(java.lang.Class cls,
java.lang.String query)
Prepare SQL statement |
void |
prepare(java.lang.String className,
java.lang.String query)
Prepare SQL statement |
java.lang.Object[] |
select(java.lang.Class cls,
QueryIterator iterator,
java.lang.String query)
Execute query |
java.lang.Object[] |
select(java.lang.Class cls,
QueryIterator iterator,
java.lang.String query,
int limit)
Execute query |
java.lang.Object[] |
select(java.lang.Class cls,
QueryIterator iterator,
java.lang.String query,
int limit,
int nThreads)
Execute query |
java.lang.Object[] |
select(java.lang.String className,
QueryIterator iterator,
java.lang.String query)
Execute query |
java.lang.Object[] |
select(java.lang.String className,
QueryIterator iterator,
java.lang.String query,
int limit)
Execute query |
java.lang.Object[] |
select(java.lang.String className,
QueryIterator iterator,
java.lang.String query,
int limit,
int nThreads)
Execute query |
void |
setBoolParameter(int index,
boolean value)
Set value of query parameter |
void |
setIntParameter(int index,
long value)
Set value of query parameter |
void |
setParameter(int index,
java.lang.Object value)
Set value of query parameter |
void |
setRealParameter(int index,
double value)
Set value of query parameter |
void |
setResolver(java.lang.Class original,
java.lang.Class resolved,
Resolver resolver)
Specify resolver. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Query()
Method Detail |
public java.lang.Object[] select(java.lang.Class cls, QueryIterator iterator, java.lang.String query, int limit, int nThreads) throws CompileError
cls
- class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crierialimit
- limitation for numbe of selected recordsnThreads
- number of threads for concurrent execution of sequential search,
if 0, then will be set equal to the number of processors available for the JVM
CompileError
public java.lang.Object[] select(java.lang.Class cls, QueryIterator iterator, java.lang.String query) throws CompileError
cls
- class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crieria
CompileError
public java.lang.Object[] select(java.lang.Class cls, QueryIterator iterator, java.lang.String query, int limit) throws CompileError
cls
- class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crierialimit
- limitation for numbe of selected records
CompileError
public java.lang.Object[] select(java.lang.String className, QueryIterator iterator, java.lang.String query, int limit, int nThreads)
className
- name of the class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crierialimit
- limitation for numbe of selected recordsnThreads
- number of threads for concurrent execution of sequential search,
if 0, then will be set equal to the number of processors available for the JVM
public java.lang.Object[] select(java.lang.String className, QueryIterator iterator, java.lang.String query) throws CompileError
className
- name of the class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crieria
CompileError
public java.lang.Object[] select(java.lang.String className, QueryIterator iterator, java.lang.String query, int limit) throws CompileError
className
- name of the class of inspected objectsiterator
- iterator for sequential and direct access to objects in the tablequery
- selection crierialimit
- limitation for numbe of selected records
CompileError
public void setParameter(int index, java.lang.Object value)
index
- parameters index (1 based)value
- value of parameter (for scalar parameters instance f correspondendt wrapper class,
for example java.lang.Long
public void setIntParameter(int index, long value)
index
- parameters index (1 based)value
- value of integer parameterpublic void setRealParameter(int index, double value)
index
- parameters index (1 based)value
- value of real parameterpublic void setBoolParameter(int index, boolean value)
index
- parameters index (1 based)value
- value of boolean parameterpublic boolean add(java.lang.Object obj)
QueryIterator.getByKeyRange
method
to store selected records
obj
- object selected by index
false
is selection limit is reached, false
otherwisepublic void prepare(java.lang.Class cls, java.lang.String query)
cls
- class of inspected objectsquery
- selection crieria with '?' placeholders for parameter valuepublic void prepare(java.lang.String className, java.lang.String query)
query
- selection crieria with '?' placeholders for parameter valuepublic java.lang.Object[] execute(QueryIterator iterator)
iterator
- iterator for sequential and direct access to objects in the table
public java.lang.Object[] execute(QueryIterator iterator, int limit)
iterator
- iterator for sequential and direct access to objects in the tablelimit
- limitation for numbe of selected records
public java.lang.Object[] execute(QueryIterator iterator, int limit, int nThreads)
iterator
- iterator for sequential and direct access to objects in the tablelimit
- limitation for numbe of selected recordsnThreads
- number of threads for concurrent execution of sequential search,
if 0, then will be set equal to the number of processors available for the JVM
public void enableRuntimeErrorReporting(boolean enabled)
enabled
- if true
then reportnig is enabledpublic void setResolver(java.lang.Class original, java.lang.Class resolved, Resolver resolver)
original
- class which instances will have to be resolvedresolved
- class of the resolved objectresolver
- class implementing Resolver interfacepublic static java.lang.Object normalizeKeyValue(java.lang.Object value)
value
- value of the key
public static java.lang.Object castLiteral(java.lang.Class type, java.lang.Object value)
type
- type to which literla should be convertedvalue
- literal value
null
value of literal is out of
specified type domain
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |