InterSystems IRIS Data Platform 2019.2  /  InterSystems Implementation Reference for Java Third Party APIs

InterSystems Implementation Reference for Java Third Party APIs
Hibernate Support
Previous section          
InterSystems: The power behind what matters   

The InterSystems Hibernate Dialect is an implementation of the Hibernate dialect interface. Since every vendor’s implementation of SQL is slightly different, the dialect interface allows vendors to create custom Hibernate mappings for a specific database. Vendor-provided dialect implementations are distributed as part of Hibernate.
This chapter provides technical details about the InterSystems Hibernate Dialect. The following topics are discussed:
Hibernate and the InterSystems Hibernate Dialect
Java Persistence Architecture (JPA) is the recommended persistence technology for complex object hierarchies in Java projects. InterSystems currently supports JPA via the Hibernate implementations of the JPA specifications. Hibernate is an open source framework from JBoss that acts as a wrapper around JDBC to provide object/relational mapping (ORM) services for relational databases. Hibernate provides a vendor-neutral persistence service, which may be a requirement for some projects.
The InterSystems Hibernate Dialect is an implementation of the Hibernate dialect interface. Since every vendor’s implementation of SQL is slightly different, Hibernate includes vendor-provided "dialects" that customize its mappings to specific databases. Current Hibernate distributions include a high performance, customized InterSystems dialect class.
When to Use Hibernate
Hibernate provides the infrastructure to persist objects to relational tables. Essentially, it is a wrapper around JDBC that allows you to focus on working with objects while transparently handling conversion between objects and tables in SQL queries. Hibernate can be used in most environments, but it is not always the best option. Here are some considerations to bear in mind:
Installation and Configuration
This section provides instructions for setting up your system to use Hibernate with InterSystems IRIS. The instructions assume that the correct versions of both InterSystems IRIS and Hibernate are installed and operational.
The following software must be installed on your system:
The instructions in this chapter refer to the following directories:
System Settings
Make the following changes to your system:
Hibernate Configuration
In the Hibernate configuration files (either or hibernate.cfg.xml), specify the connection information for your database, and the name of the InterSystems dialect class.
The following five configuration properties are required:
A typical entry in would contain the following lines (change url, username, and password as appropriate for your system)):
  hibernate.dialect org.hibernate.dialect.InterSystemsIRISDialect
  hibernate.connection.driver_class com.intersystems.jdbc.IRISDriver
  hibernate.connection.url jdbc:IRIS://
  hibernate.connection.username _SYSTEM
  hibernate.connection.password SYS
The following example shows the same information as it would appear in hibernate.cfg.xml:
      <property name="dialect">
      <property name="connection.driver_class">
      <property name="connection.username">_SYSTEM</property>
      <property name="connection.password">SYS</property>
      <property name="connection.url">
If the same property is set in both and hibernate.cfg.xml, Hibernate will use the value from hibernate.cfg.xml.
Dialect File Locations
The InterSystems Hibernate dialect consists of four files that should be located as follows
(where <hibernate> is hibernate-orm\hibernate-core\src\main\java\org\hibernate):
If you do not already have these files, contact the InterSystems Worldwide Response Center (WRC) for download information.

Previous section          
Send us comments on this page
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-08-22 05:46:30