Friday, July 31, 2009

EclipseLink JPA

The Eclipse Persistence Services Project (EclipseLink) delivers a comprehensive open-source Java persistence solution.
http://www.eclipse.org/eclipselink/

Developing Applications using EclipseLink JPA
http://wiki.eclipse.org/Category:JPA

Introduction to Java Persistence API (ELUG)
http://wiki.eclipse.org/Introduction_to_Java_Persistence_API_%28ELUG%29

Configuring EclipseLink in Eclipse Galileo


How to use Application Scoped Data Sources in WebLogic with EclipseLink JPA

http://wiki.eclipse.org/EclipseLink/Examples/JPA/WLS_AppScoped_DataSource


persistence.xml using JTA
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.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_1_0.xsd">
<persistence-unit name="testJPA" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/app/jdbc/SimpleAppScopedDS</jta-data-source>

<class>testEAR.Author</class>
<class>testEAR.Book</class>
<properties>
<property name="eclipselink.target-server" value="WebLogic_10"/>
<property name="javax.persistence.jtaDataSource" value="java:/app/jdbc/SimpleAppScopedDS" />
</properties>
</persistence-unit>
</persistence>



[EL Finest]: 2009-07-31 14:42:43.602--UnitOfWork(4744686)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query ReadObjectQuery(referenceClass=Author sql="SELECT AUTHOR_ID, LAST_NAME, EMAIL, FIRST_NAME FROM AUTHOR WHERE (AUTHOR_ID = ?)")
[EL Fine]: 2009-07-31 14:42:43.602--ServerSession(18462140)--Connection(17112484)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT AUTHOR_ID, LAST_NAME, EMAIL, FIRST_NAME FROM AUTHOR WHERE (AUTHOR_ID = ?)
bind => [1]
[EL Finest]: 2009-07-31 14:42:43.68--ServerSession(18462140)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--Execute query ReadAllQuery(name="books" referenceClass=Book sql="SELECT BOOK_ID, TITLE, PUBLISH_DATE, AUTHOR_ID FROM BOOK WHERE (AUTHOR_ID = ?)")
[EL Fine]: 2009-07-31 14:42:43.68--ServerSession(18462140)--Connection(12687286)--Thread(Thread[[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)',5,Pooled Threads])--SELECT BOOK_ID, TITLE, PUBLISH_DATE, AUTHOR_ID FROM BOOK WHERE (AUTHOR_ID = ?)
bind => [1]

No comments:

Post a Comment