5 Replies Latest reply: Aug 13, 2014 4:45 AM by Kylin Soong RSS

Teiid support for EclipseLink persistance provider

Sunil Varma Newbie

Is there any support for the EclipseLink JPA provider? I was able to use the Hibernate one based on the documentation but didnt find any material on using Teiid over EclipseLink.

 

Thanks

Sunil

  • 1. Re: Teiid support for EclipseLink persistance provider
    Steven Hawkins Master

    We don't have any explicit documentaiton or classes related to usage through EclipseLink.  You should be able to use us as a standard JDBC driver.  There may need to be someing akin to our Teiid Hibernate Dialect to support better integration though.  Can you log a JIRA?

     

    Thanks,

    Steve

  • 2. Re: Teiid support for EclipseLink persistance provider
    Kylin Soong Newbie

    Hi Sunil

     

    It's quite a long time since we hear from you last time, does this issue be solved?

     

    Seems EclipseLink doesn't need a dialect for mapping with persistence layer, Teiid Support EclipseLink, I have write a sample eclipselink-on-top-of-teiid, it contain a detailed step by step procedure for how to use Teiid with EclipseLink, can you look at it and give us some feedback?

     

    In my Test, the persistence.xml configured like:

     

    <persistence version="2.0"
       xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
            http://java.sun.com/xml/ns/persistence
            http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
       <persistence-unit name="org.teiid.quickstart"  transaction-type="RESOURCE_LOCAL">
             
          <class>org.teiid.quickstart.eclipselink.model.ProductInfo</class>
          
          <properties>
          <property name="javax.persistence.jdbc.driver" value="org.teiid.jdbc.TeiidDriver" />
          <property name="javax.persistence.jdbc.url" value="jdbc:teiid:EclipseLink_Portfolio@mm://localhost:31000;version=1" />
          <property name="javax.persistence.jdbc.user" value="user" />
          <property name="javax.persistence.jdbc.password" value="user" />
    
          <!-- EclipseLink should create the database schema automatically -->
          <property name="eclipselink.ddl-generation" value="create-tables" />
          <property name="eclipselink.ddl-generation.output-mode" value="database" />
        </properties>
          
       </persistence-unit>
    </persistence>
    

     

    Cheers

    Kylin

  • 3. Re: Teiid support for EclipseLink persistance provider
    Kylin Soong Newbie

    Hi Steve

     

    I have done a little investigation for EclipseLink, seems EclipseLink not need a dialect for mapping with Teiid, basic JDBC parameters(url,driver,username,password) is enough,I have written eclipselink-on-top-teiid sample as above updates, it run quite well.

     

    Can you share your idea regarding to the issue?

     

    Thanks

    Kylin

  • 4. Re: Teiid support for EclipseLink persistance provider
    Steven Hawkins Master

    That's good news.  So that is effectively using the auto/default database-target.  There is also a DatabasePlatform class that can be used to refine eclipselink's behavior - see http://wiki.eclipse.org/Introduction_to_Data_Access_%28ELUG%29#Database_Platforms

     

    So we may eventually want to develop a Teiid specific DatabasePlatform.

     

    How does the generated ddl option work?

  • 5. Re: Re: Teiid support for EclipseLink persistance provider
    Kylin Soong Newbie

    Yes, if we don't define Platform, the default DatabasePlatform be used, we need Teiid specific DatabasePlatform.

     

    The ddl option related with DatabasePlatform we used, so far if we configure ddl-generation to drop-and-create-tables as below:

     

    <property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
    

    The JPA entity manager init failed, teiid don't support create/alter table DDL, I think we can use TeiidPlatform handle this.

     

    Any advice please feel free let me know.