public interface IDBQuery<TEntity extends IEntity>
IDBQuery iQuery = ...;
iQuery.setQueryPart (0, EQueryPartBinding.AND, EQueryPartOperation.MATCH, "a", 1 );
iQuery.setQueryPart (1, EQueryPartBinding.AND, EQueryPartOperation.LIKE , "b", "any_val*");
First line add an operation 'a = 1' to the internal query. The boolean operation AND will be ignored ...
because there is no further leading operation on the left side .-)
Second line add an operation 'and b like any_val%' to the internal query.
Because it's not the leading operation the boolean operator AND will be used real here.
Further the wildcard-asterix '*' will be translated to a value which is supported
by the internal DB back end.
First parameter of setQueryPart () will specify an index of that query part within
the internal created query (string). So you can mix these two lines of code in any order ...
if you don't change the index value itself ... the result will be always the same.| Modifier and Type | Method and Description |
|---|---|
String |
getId() |
void |
setQueryPart(int nPosition,
EQueryPartBinding eBinding,
EQueryPartOperation eOperation,
String sAttribute,
Object aValue)
define one part of the query ...
|
String getId() throws Exception
Exceptionvoid setQueryPart(int nPosition,
EQueryPartBinding eBinding,
EQueryPartOperation eOperation,
String sAttribute,
Object aValue)
throws Exception
nPosition - [IN]
the position of that part within the query.
Must start at 0.eBinding - [IN]
define the boolean operator (and/or) against the part
placed at nPosition-1.
Will be ignored if nPosition==0.eOperation - [IN]
define the operation used by this part (==, like, between ...)sAttribute - [IN]
the name of the attribute to be checked here.aValue - [IN]
the search value itself.
Note For the given value there exists some conditions ...
a) if eOperation=like it must be from type String.
b) if eOperation=between it must be from type BetweenQueryRange.ExceptionCopyright © 2016 as-development.net. All rights reserved.