com.ibm.tspaces.query
Class MatchQuery
java.lang.Object
|
+--com.ibm.tspaces.query.MatchQuery
- public class MatchQuery
- extends java.lang.Object
- implements Query
Class MatchQuery
This class extends the generic Query interface.
An MatchQuery object is specified at the
client and passed to the server in a template tuple. At the server,
it is transformed to a TSMatchQuery object that is actually used for the
query operation.
This is really just an alternative way to expressing a regular
template match.
Example usage:
String value1 = "any old data";
String key1 = "mykey";
ts.write(key1,value1);
...
Tuple template = new Tuple(key1,new Field(String.class));
ts.take(template); // normal way
or
ts.take(new MatchQuery(template));
The MatchQuery is required when using AndQuery or OrQuery
MachQuery mq = new MatchQuery(template);
IndexQuery iq = new IndexQuery("index1","key");
ts.take(new AndQuery(iq,mq));
- Author:
- John Thomas
- See Also:
SuperTuple,
Query, Serialized Form
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
MatchQuery
public MatchQuery(SuperTuple tuple_)
- Create a new MatchQuery
- Parameters:
tuple_ - The SuperTuple to matchq2_ - The second query
getTuple
public SuperTuple getTuple()
- access the Tuple that defines this Match Query