Inductor

Inductor is a fully declarative, type-safe ORQL software package that maximizes query expressiveness and minimizes object/relational impedance mismatch. Inductor layers seamlessly over the existing Hibernate and JDO query engines to add a new, SQL syntax, pure Java query style.
Features
Declarative — implements a relationally-complete, purely declarative query grammar that closely parallels standard SQL in syntax and logic.
Type-safe — implements the query grammar entirely in objects and as method calls with the result that the vast majority of parameter and return values are statically type-checked and the remainder are dynamically type-checked.
Design patterns — a well-defined set of Inductor specific design patterns ensure refactorability and project-wide consistent definition and efficient execution of Inductor queries.
Persistence-package agnostic — the query grammar and syntax are independent of the underlying persistence-package!
Advantages
— An Inductor query is as clear, concise, and declarative as an equivalent native SQL query. Inductor queries read very much like a standard SQL queries.
— Implements a well-defined object QBE operation and the SQL operators like, in, and between consistently for all supported persistence-packages.
— The Inductor query grammar and design patterns are designed to be independent of the underlying persistence-package used.
— Pluggable drivers adapt Inductor for use with different object persistence packages and provide access to package specific features.
— The Inductor package hides and automatically implements the procedural mechanics required to execute queries through the underlying persistence package.
— Inductor specific design patterns efficiently handle a full range of query-cases.
— Inductor design patterns can be used alone or in most any combination:
- ad hoc singleton select pattern;
- thread-safe select pattern;
- explicit attached and detached query result selection patterns;
- project-consistency pattern for ensuring well-defined, refactorable query specification and execution; and
- singleton field-name class pattern for annotations.
Development State
Beta release is available. All major features planned for the initial Inductor release have been implemented. JDO and Hibernate drivers are included in the current release package. The driver for EJB 3.0 is currently in design.
Installation & Requirements
Ensure that a persistence package is installed and working. Inductor depends on the underlying persistence package to function.
Inductor does not require any configuration parameters beyond those required by the persistence package. The included jdo.properties and hibernate.cfg.xml configuration files are only samples.
Ensure the certiv-inductor-0.30.jar is on the classpath.
Run the ApiTest routines as typical use cases to verify function.
Faq
- The from clause must come before the select, where, orderBy, and groupBy clauses.
- The first listed field-name class in the from clause determines the type of the persistence-capable class returned by the query.
- A known bug will cause exceptions when there are certain repeated uses of a field within a single criteria element. Generally, criteria of the form:
pers.firstname.eq("Bob").and(pers.firstname.eq("Summer");... can be rewritten to remove the redundant reference or to split the reference into separate criteria elements:pers.firstname.eq("Bob"),
pers.firstname.eq("Summer") - In a persistent class:
- the values of the field-name reference string constants must identically match the names of the persistence fields.
- the names of the field-name reference string constants are not constrained. Good practice is to maintain a closely parallel naming scheme.
- (HIB) the getters/setters must follow the Sun BeanSpec naming convention or the hibernate configuration must specify field-level access.
- (JDO) the getters/setters are not required -- access is always field-level.
- (JDO) Only a single orderBy field is supported in the current version of JPox
- (JDO) The current version of JPox does not support the groupBy clause
- (HIB) The select clause only supports aggregate functions