You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@tomee.apache.org by bu...@apache.org on 2012/08/14 12:08:38 UTC

svn commit: r828881 - in /websites/staging/openejb/trunk: cgi-bin/ content/ content/examples-trunk/jpa-eclipselink/README.html

Author: buildbot
Date: Tue Aug 14 10:08:38 2012
New Revision: 828881

Log:
Staging update by buildbot for openejb

Modified:
    websites/staging/openejb/trunk/cgi-bin/   (props changed)
    websites/staging/openejb/trunk/content/   (props changed)
    websites/staging/openejb/trunk/content/examples-trunk/jpa-eclipselink/README.html

Propchange: websites/staging/openejb/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Aug 14 10:08:38 2012
@@ -1 +1 @@
-1372696
+1372820

Propchange: websites/staging/openejb/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Tue Aug 14 10:08:38 2012
@@ -1 +1 @@
-1372696
+1372820

Modified: websites/staging/openejb/trunk/content/examples-trunk/jpa-eclipselink/README.html
==============================================================================
--- websites/staging/openejb/trunk/content/examples-trunk/jpa-eclipselink/README.html (original)
+++ websites/staging/openejb/trunk/content/examples-trunk/jpa-eclipselink/README.html Tue Aug 14 10:08:38 2012
@@ -154,9 +154,11 @@
 </h1>
 </div>
 
-<p><em>Help us document this example! Click the blue pencil icon in the upper right to edit this page.</em></p>
+<p>This example shows how to configure <code>persistence.xml</code> to work with Eclipselink. It uses an <code>@Entity</code> class and a <code>@Stateful</code> bean to add and delete entities from a database.</p>
 
-<h2>Movie</h2>
+<h2>Creating the JPA Entity</h2>
+
+<p>The entity itself is simply a pojo annotated with <code>@Entity</code>.  We create one pojo called <code>Movie</code> which we can use to hold movie records.</p>
 
 <pre><code>package org.superbiz.eclipselink;
 
@@ -212,7 +214,10 @@ public class Movie {
 }
 </code></pre>
 
-<h2>Movies</h2>
+<h2>Database Operations</h2>
+
+<p>This is the bean responsible for database operations; it allows us to persist or delete entities.
+For more information we recommend you to see http://openejb.apache.org/examples-trunk/injection-of-entitymanager/README.html</p>
 
 <pre><code>package org.superbiz.eclipselink;
 
@@ -244,7 +249,11 @@ public class Movies {
 }
 </code></pre>
 
-<h2>persistence.xml</h2>
+<h2>Persistence.xml with EclipseLink configuration</h2>
+
+<p>This operation is too easy, just set the <code>provider</code> to <code>org.eclipse.persistence.jpa.PersistenceProvider</code> and add additional properties to the persistence unit. 
+The example has followed a strategy that allows the creation of tables in a HSQL database.
+For a complete list of persistence unit properties see, http://www.eclipse.org/eclipselink/api/2.4/org/eclipse/persistence/config/PersistenceUnitProperties.html</p>
 
 <pre><code>&lt;persistence version="1.0"
              xmlns="http://java.sun.com/xml/ns/persistence"
@@ -265,6 +274,8 @@ public class Movies {
 
 <h2>MoviesTest</h2>
 
+<p>Testing JPA is quite easy, we can simply use the <code>EJBContainer</code> API to create a container in our test case.</p>
+
 <pre><code>package org.superbiz.eclipselink;
 
 import junit.framework.TestCase;
@@ -307,6 +318,8 @@ public class MoviesTest extends TestCase
 
 <h1>Running</h1>
 
+<p>When we run our test case we should see output similar to the following.    </p>
+
 <pre><code>-------------------------------------------------------
  T E S T S
 -------------------------------------------------------