So far we have dealt with simple queries supplied by the convenience classes. However, often we want to be able to query the data in a more complex manner, including multiple attribute criteria and even multiple class querying.
It is always difficult to choose an appropriate model for an unfamiliar query language and in this case Jofti provides two options. The first, and most expressive, is based on the EJB3 QL specification, the second is based on SQL. This decision was made for two main reasons.
1) Make the learning curve of yet another query language as small as possible by basing the languages on existing standards.
2) The operations on the index are extremely similar (although not identical) to the sorts of queries you
would write in EJB3 or SQL to access persisted data.
Although, it is worth mentioning that as Jofti is not dealing with persisted data, it does not implement all of EJB3 QL or ANSI SQL and accordingly, there are some parts of both standards which are not emulated (such as JOIN ).
It is worth pointing out that neither SQL or EJB3 QL are a core part of Jofti, just a convenient way of querying the index and future versions may include other representations such as the XPath query mechanism.
The use of the specific data types in each query language are dealt with in the Data Types section.
One thing to mention is that the convenience classes offer a speed advantage over the parsed query language (due to the parsing step) and if you can support your query requirements with those classes it will benefit the application's performance.
Of course (as ever), it is a trade off between speed and flexibility. The 1.2 version of Jofti includes static named complex queries which can be registered against the index (in the way stored procedures are used).
Details of the different query types are outlined in: