Hibernate Persistence for OpenEAI RDBMS Connector

The OpenII Toolkit for OpenEAI ("Toolkit") is a proprietary toolkit for the open source OpenEAI framework. The Toolkit was developed by OpenII and the University of Illinois, and the creators are working to contribute the Toolkit to the OpenEAI Project, so it can be released under open source licenses. Emory has a license to use the proprietary Toolkit, and Emory and the University of Illinois continue to use and enhance the Toolkit. This is why these institutions are working to open source the Toolkit---to make it easier to enhance the Toolkit and share enhancements.

One feature of the Toolkit is a Relational Database Management System (RDBMS) connector, that helps expose data in relational databases as services on and Enterprise Service Bus. The RDMBS connector consists of OpenEAI commands and persistence helpers to assist in mapping message objects to the underlying database. The original command and persistence helper provided allowed analysts or developers to map message objects to the underlying database using SQL statements (InlineSqlPersistenceHelper). This mapping method and foundation has been used extensively. Recently, Dr. George Wang developed a Hibernate persistence helper, which can be substituted in this framework.

Quick Start

HelloHibernate - Readers who are unfamiliar with Hibernate, or who want to refresh their memory may find this example useful.  For detail object-relational mapping using hibernate, please see Hibernate Reference Documentation.

HelloHibernateService: steps to convert HelloHibernate into HelloHibernateService

Advanced QuerySpecification with Operators and QueryLanguage Elements

The introduction of Hibernate provided the opportunity to add advanced query parameters and query language elements to query specifications. This allows significant flexibility in querying data services. This functionality is not limited to services that use Hibernate for persistence, but the fact that Hibernate supports these query methods suggested that these should be exposed to the service layer.

Example Service - NutrientDatabaseServiceHibernate

NutrientDatabaseService is an OpenEAI RDBMS connector that provides nutrient description for each food item. Table FOOD_DES and NUTR_DEF has a many-to-many relationship.

The example service is deployed in the Emory Development Environment at https://intesbdev1.cc.emory.edu:8443/consoleq4/

HibernatePersistence specific artifacts:

  • emoryoit/deployment/esb/dev/InputFiles/NutrientDatabaseService/hibernate.cfg.xml, and each individual .hbm.xml hibernate object mapping files.  In FoodDescription.hbm.xml, please pay attention to bag element, and node="." inside bag element.
  • emoryoit/deployment/esb/dev/Jars/NutrientDatabaseService/*.jar
  • HibernateRdbmsRequestCommand and HibernatePersistenceHelper in AppConfig

Configuring OpenEAI Services to Use Hibernate

Configuring OpenEAI Services to Use Hibernate for converting an existing service to use Hibernate.

 

Known Issues or Limitations

Current implementations of OpenEAI Date and Datetime type requires a moa which has asymmetrical getter and setter for these two types.  See detail at OpenEAI Date and Datetime type and emory-moa-1.2.jar

Reference

Hibernate, version, and optimistic locking

Hibernate Reference Documentation.

Like