2019-05-13

The Story of Ujorm Framework

How much time can Ujorm Framewrok save and why was it created in the first place? The following article addresses more than these questions.


Somewhere back in 2008, I had an opportunity to participate in development of an interesting transport reservations system written in Java. The frontend was built on RichFaces, a former component framework for Sun Microsystems' JavaServer Faces, a business logic was placed into service classes managed by Spring framework, persistent layer was built on Hibernate ORM framework.
See the full article on Github ...





2014-04-27

Key-value Coding in Java

I would like to introduce a guide to the key-value architecture of domain objects where their attributes are provided using objects called Keys only. The Key-value approach simplifies and accelerates the development of applications. Practical use is demonstrated in the Demo-Hotels project linked at the end of the original article. The chapter list follows:
  • Writing and reading values
  • Restoring default values
  • Shallow copy of an object
  • Validation attributes when writing
  • Composite Keys
  • Criterion as a condition model
  • Criterion for filtering collection
  • Collection sorting
  • Serialization of Keys
  • Import from CSV format

Short examples are based on the Ujorm library.

key-value-model

Link to the original article:
http://ujorm.org/sample/key-value.html

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.

2013-10-01

The CRUD application for Ujorm and Wicket

The java library Ujorm was introduced in 2008 under the old name UJO Framework. Since then, five years have passed and the source code has been modified many times but the basic idea - accessing to the properties by constants called keys - remains.

I would like to present a small web project for hotel booking to show an interesting features of the Ujorm library. Graphical interface is rendered by the  Apache Wicket framework.

See the next screenshot of the form dialog including a source code:

hotelFormGui


hotelFormCode

To be continued ...

2013-01-20

Ujorm 1.32 released

The new release of Ujorm framework is released with two major features:
  • the new validators are available for checking a consistency of the input values. The Ujorm validators have got a similar meaning for Ujo object how the Bean Validation (JSR 303) implementation for the JavaBeans.  For more information see the the documentation or a jUnit tests.
  •  the ORM supports reading a related database tables by the one SQL request using an extended implementation of the Query object. More information are described in ORM user guide.
See a more information on the release notes page.