[seam-commits] Seam SVN: r7680 - trunk/doc/reference/en/modules.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Mar 24 13:35:22 EDT 2008


Author: jbalunas at redhat.com
Date: 2008-03-24 13:35:22 -0400 (Mon, 24 Mar 2008)
New Revision: 7680

Modified:
   trunk/doc/reference/en/modules/configuration.xml
   trunk/doc/reference/en/modules/persistence.xml
Log:
JBSEAM-1946, JBSEAM-2761
added section on using an alternate JPA provider.

Modified: trunk/doc/reference/en/modules/configuration.xml
===================================================================
--- trunk/doc/reference/en/modules/configuration.xml	2008-03-24 17:28:31 UTC (rev 7679)
+++ trunk/doc/reference/en/modules/configuration.xml	2008-03-24 17:35:22 UTC (rev 7680)
@@ -427,6 +427,50 @@
         </sect2>
 
     </sect1>
+    
+    <sect1 id="alt-jpa-providers">
+        <title>Using Alternate JPA Providers</title>
+        
+        <para> Seam comes packaged and configured with Hibernate as the primary JPA provider.
+        This helps with the <emphasis>Configuration by Exception</emphasis> concept.
+        If you require using a different JPA provider you must tell <literal>seam</literal>
+        about it.
+        </para>
+        
+        <para>This can be be done in one of two ways:
+            <itemizedlist>
+                <listitem>
+                    <para>Update your application's <literal>components.xml</literal>
+                    so that the generic <literal>PersistenceProvider</literal> takes
+                    precedence over the hibernate version.  Simply add the following
+                    to the file:
+                    <programlisting><![CDATA[<component name="org.jboss.seam.persistence.persistenceProvider" 
+           class="org.jboss.seam.persistence.PersistenceProvider"
+           scope="stateless">
+</component>]]></programlisting>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>If you want to take advantage of your JPA providers 
+                    non-standard features you will need to write you own implementation of
+                    the <literal>PersistenceProvider</literal>.  Use 
+                    <literal>HibernatePersistenceProvider</literal> as a starting 
+                    point (don't forget to provide it to the community :).  Then you
+                    will need to tell <literal>seam</literal> to use it as before.
+                    <programlisting><![CDATA[<component name="org.jboss.seam.persistence.persistenceProvider" 
+           class="org.your.package.YourPersistenceProvider">
+</component>]]></programlisting>
+                    
+                    </para>
+                </listitem>            
+            </itemizedlist>            
+        </para>
+        <para>All that is left is updating the <literal>persistence.xml</literal>
+            file with the correct provider class, and what ever properties it 
+            needs.  Don't forget to package your new provider's jar files in the 
+            application if they are needed.
+        </para>
+    </sect1>
 
     <sect1>
         <title>Configuring Seam in Java EE 5</title>

Modified: trunk/doc/reference/en/modules/persistence.xml
===================================================================
--- trunk/doc/reference/en/modules/persistence.xml	2008-03-24 17:28:31 UTC (rev 7679)
+++ trunk/doc/reference/en/modules/persistence.xml	2008-03-24 17:35:22 UTC (rev 7680)
@@ -484,7 +484,8 @@
             API via the <literal>getDelegate()</literal> method. Naturally, the most interesting
             vendor is Hibernate, and the most powerful delegate interface is
             <literal>org.hibernate.Session</literal>. You'd be nuts to use anything else. Trust
-            me, I'm not biased at all.
+            me, I'm not biased at all.  For configuring alternate JPA providers see
+            <link linkend="alt-jpa-providers">Using Alternate JPA Providers</link>
         </para>
         
         <para>




More information about the seam-commits mailing list