<property name="javax.persistence.jdbc.driver" value="org.teiid.jdbc.TeiidDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:teiid:<vdb-name>@mm://<host>:<port>" />
<property name="javax.persistence.jdbc.user" value="<username>" />
<property name="javax.persistence.jdbc.password" value="<password>" />
Using Teiid with EclipseLink
Overview
We can use Teiid with Hibernate, we also have a quick start show how Hibernate on top of Teiid. Both Hibernate and Eclipselink are fully support JSR-317 (JPA 2.0), primary purpose of this document is demonstrate how use Teiid with EclipseLink.
Configuration
For the most part, interacting with Teiid VDBs (Virtual Databases) through Eclipselink is no different from working with any other type of data source. First, depending on where your Eclipselink application will reside, either in the same VM as the Teiid Runtime or on a separate VM, will determine which jar’s are used.
-
Running in same VM in the WildFly server, the teiid-client-{version}.jar and teiid-eclipselink-platform-{version}.jar are needed
-
Running separate VM’s,you need the Teiid JDBC Driver JAR(Download Teiid JDBC Driver JAR) and Teiid’s Eclipselink Platform JAR(teiid-eclipselink-platform {version}.jar) in the Eclipselink’s classpath.
These JAR files have the org.teiid.eclipselin.platform.TeiidPlatform and org.teiid.jdbc.TeiidDriver classes.
You configure EclipseLink (via persistence.xml) as follows:
-
Specify the Teiid driver class, connection url
-
Specify the Teiid platform class
<property name="eclipselink.target-database" value="org.teiid.eclipselink.platform.TeiidPlatform"/>
Limitations
-
Many Eclipselink use cases assume a data source has the ability (with proper user permissions) to process Data Definition Language (DDL) statements like CREATE TABLE and DROP TABLE as well as Data Manipulation Language (DML) statements like SELECT, UPDATE, INSERT and DELETE. Teiid can handle a broad range of DML, but does not directly support DDL against a particular source.
-
Sequence generation is not directly supported.