2014-03-11

Ujorm version 1.44

there is available a new version Ujorm in Maven repositories with a long-awaited support for creating hierarchical queries for a database relations to itself. Previously it was necessary to use a native SQL commands, however it can be modeled using Ujorm key type by an extended alias name for relation now. The next example shows a query for all Customers with a surename "Brown" and grandparent called "Smith":

     Criterion<Customer> crn1, crn2, crn3;
     crn1 = Customer.PARENT.alias("parent1")
       .add(Customer.PARENT).alias("parent2")
       .add(Customer.SURENAME).whereEq("Smith");
     crn2 = Customer.SURENAME.whereEq("Brown");
     crn3 = crn1.and(crn2);

     Customer customer = session.createQuery(crn3).uniqueResult();

aliases can be used also in some cases where one entity contains multiple keys to the same entity, an example may be two relations Person.MOTHER, Person.FATHER.


Other features of the Ujorm series 1.4x:
  • XML configuration of an ORM meta-model can be validated using a XSD file
  • and there is available a new module (ujo-xsd) to generate XSD files accoridng an UJO class
  • ORM supports native DB sequences using the class NativeDbSequencer
  • ORM lazy loading can be enabled (optionally by a parameter) on the closed session too, for the case an action opens a new DB connection for a necessary short time only
  • there was removed the interfaces Property, which has been deprecated since version 1.30 and should be replaced by a new interface Key (including related methods)


more detailed description is in the release notes.