|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OQLQuery
The interface to an OQL query object.
Method Summary | |
---|---|
void |
bind(Object parameter)
Bind a parameter to the query. |
void |
create(String query)
Create an OQL query from the string parameter. |
Object |
execute()
Execute the query. |
Method Detail |
---|
void create(String query) throws QueryInvalidException
OQLQuery
object must be created
by calling Implementation.newOQLQuery
, then calling the
create
method with the query string.
The create
method might throw QueryInvalidException
if the query could not be compiled properly. Some implementations may not want
to compile the query before execute
is called. In this case
QueryInvalidException
is thrown when execute
is called.
query
- An OQL query.
QueryInvalidException
- The query syntax is invalid.void bind(Object parameter) throws QueryParameterCountInvalidException, QueryParameterTypeInvalidException
create
by $i,
where i is the rank of the parameter, beginning with 1.
The parameters are set consecutively by calling this method bind
.
The ith variable is set by the ith call to the bind
method.
If any of the $i are not set by a call to bind
at the point
execute
is called, QueryParameterCountInvalidException
is thrown.
The parameters must be objects, and the result is an Object
.
Objects must be used instead of primitive types (Integer
instead
of int
) for passing the parameters.
If the parameter is of the wrong type,
QueryParameterTypeInvalidException
is thrown.
After executing a query, the parameter list is reset.
QueryParameterCountInvalidException
- The number of calls to
bind
has exceeded the number of parameters in the query.
QueryParameterTypeInvalidException
- The type of the parameter does
not correspond with the type of the parameter in the query.Object execute() throws QueryException
ODMGException
.
Integer
object. When OQL returns a collection (literal or object),
the result is always a Java collection object of the same kind
(for instance, a DList
).
QueryException
- An exception has occurred while executing the query.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |