Inductor provides a rather robust set of SQL-type operators. Although implemented as a layer over different persistence packages, Inductor is able to provide a unified IQL syntax that actually implements a super-set of the functions native to the underlying persistence packages. Perhaps the most significant addition is the addition of QBE capabilities to the JDO packages and Field#in and Field#between to both Hibernate and JDO. Also, the join function of Hibernate has been significantly simplified and effectively standardized.
Below is an introduction to these features.
q.where(fname.like("M%ry");
q.where(fname.startsWith("M").endsWith("ry");
q.where(fname.between("M%", "%ry");
q.where(fname.in(new String[] { "M_ry", "M_rry", "M%th%r_y" });
By default, the IQL implementation of the like and related constraints use ANSI-SQL standard wildcards: '%' for multicharacter matching and '_' for single character matches. Inductor can be switched to using the native wildcards of the underlying persistence package by a method call applied to the driver.
A full QBE query can be performed using the view-name field defined within a field-name class.
// create instance with desired values
Employee e = new Employee();
e.setFName("M%");
e.setLName("Richards");
e.setTitle("%Officer%");
// persistence record reference public Class record = Employee.class; ... // view-name field public Field qbe = new Field(record);
q.where(qbe.like(e));
Based on the values contained in the persistence-capable class instance, the non-blank Fields defined in the applicable Field-Name class are matched using a like operator. That is, the QBE is performed on the intersection of (1) non-zero numbers and (2) non-null, non-zero length strings in the persistent class object, and (3) for only those Fields defined within the field-name class that contains the view-name Field.
Works, just missing the write-up.