Are you looking for another ORM famework? The Ujorm is designed for rapid Java development with great performance and a small footprint. The key features are type safe queries, relation mapping by Java code, no entity states, and a memory overloading protection cache. Try it!



Why a new ORM mapping?

Simplified Class Model of The Ujorm The Ujorm is designed primarily for the rapid Java development based on a relation database.
  • java compiler can discover a syntax error of Ujorm database query similar like 4GL database languages
  • easy to configure the ORM model by java source code, optionally by annotations and a XML file
  • great performance, some types of SELECT query are very fast in comparison to its competitors
  • lazy initialization is supported
  • database incremental update (according to the model meta-model) is supported by DDL commands
  • no confusing proxy or binary modified business objects
  • very lightweight framework with no library dependencies


Some other features

  • multi row insert, update and delete is supported by a single SQL statement
  • resources for ORM mapping can be a database table, view or native SQL SELECT
  • LIMIT and OFFSET are supported
  • subset of table columns on SELECT can be specified for the SQL statement
  • JDBC query parameters are passed by a 'question mark' notation to the PreparedStatement for a high security
  • stored database procedures and functions are supported
  • all persistent objects are based on the interface OrmUjo, namely on the implementation OrmTable
  • internal object cache is based on the WeakHashMap class so that large transactions does not cause any OutOfMemoryException
  • database indexes are created by the meta-model, added support for unique, non-unique indexes including the composed one
Some parts of the API was inspired by Canyenne and Hibernate frameworks. I would like to thank the authors for great work.


Sample of usage:

See how to create database and to how to INSERT an order with two items into database:
  Order order = new Order();
  order.setDate(new Date());
  order.setNote("My order");

  Item item = new Item();
  item.setNote("Yellow table");

  Session session = ormHandler.createSession();;;

The next example selects data from database:

  Session session = ormHandler.createSession();
  Criterion<Item> crn1, crn2, criterion;

  crn1 = Criterion.where( Item.ID, GE, 1L );
  crn2 = Criterion.where( Item.ORDER.add(Order.NOTE)
                        , "My order" ); // Equals to
  criterion = crn1.and(crn2);

  for (Item item : session.createQuery(criterion)) {
      Date created = item.getOrder().getDate();
      System.out.println( item + " : " + created );
using the similar generated SQL command:
 JOIN order ON = item.id_order
 WHERE >= 1
 AND order.note = 'My order' ;
where both parameters are passed by a 'question mark' notation for a better security. And how to get meta-data for a 'description' property of the Order?
  MetaColumn col = (MetaColumn)
       ormHandler.findColumnModel( Order.NOTE );

  String msg
      = "DB name: " + col.getFullName()  + '\n'
      + "Comment: " + col.getComment()   + '\n'
      + "Length : " + col.getMaxLength() + '\n'
      + "NotNull: " + col.isMandatory()  + '\n'
      + "Primary: " + col.isPrimaryKey() + '\n'
      + "Dialect: " + col.getDialectName()
Prints the text report on the console output:
 DB name: db1.ord_order.NOTE
 Comment: Description of the Order
 Length : 128
 NotNull: true
 Primary: false
 Dialect: H2Dialect


Reference projects

  • The eCall is a complete software solution for management of corporate telecommunications - especially for a modern call center. It enables easy organization, management and automated operation of all telecommunications. See Ujorm development Interview.
  • The Inspectime is a server side Time tracking application based on the GWT Ext and Ujorm framework.
  • The system ÚZEI is used primarily for collecting information about organic agriculture in a region. The application is designed for administrators and inspectors of monitoring organizations. Inspectors enter the data through a web interface from office, but also from the field during the inspections of organics farms.
  • Do you wish to make reference to your application, built on Ujorm? Send us a link to your project to the email address .



Similar frameworks:

There are some links to similar open-source frameworks with a type-safe queries:
  • SimpleORM - object relational mapping system that avoids exotic technologies such as byte code generation, where queries can be specified in terms of Java objects, object identity is aligned with database keys.
  • Empire-db - relational data persistence component which allows database vendor independent dynamic query definition with a special focus on compile-time safety, reduced redundancies and improved developer productivity.
  • Querydsl - a framework which enables the construction of statically typed SQL-like queries