[seam-commits] Seam SVN: r7725 - branches/Seam_2_0/doc/Seam_Reference_Guide/en.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Mar 27 20:44:23 EDT 2008


Author: jbalunas at redhat.com
Date: 2008-03-27 20:44:23 -0400 (Thu, 27 Mar 2008)
New Revision: 7725

Modified:
   branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml
   branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml
Log:
JBSEAM-1946 - re-added the documentation for using different JPA providers.  This is workaround until the redesign is finished.

Modified: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml	2008-03-27 18:09:46 UTC (rev 7724)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml	2008-03-28 00:44:23 UTC (rev 7725)
@@ -421,6 +421,50 @@
         </sect2>
 
     </sect1>
+    
+    <sect1 id="alt-jpa-providers">
+        <title>Using Alternate JPA Providers</title>
+        
+        <para> Seam comes packaged and configured with Hibernate as the default JPA provider.
+        If you require using a different JPA provider you must tell <literal>seam</literal>
+        about it.  
+        </para>
+        
+        <note>
+            <title>This is a workaround</title>
+            <para>
+            Configuration of the JPA provider will be easier in the future and will
+            not require configuration changes, unless you are adding a custom persistence provider
+            implementation.
+            </para> 
+        </note>
+        
+        <para>Telling seam about a different JPA provider can be be done in one of two ways:</para>
+        <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:                    
+        </para>
+        <programlisting role="XML"><![CDATA[<component name="org.jboss.seam.persistence.persistenceProvider" 
+           class="org.jboss.seam.persistence.PersistenceProvider"
+           scope="stateless">
+</component>]]></programlisting>
+        <para>If you want to take advantage of your JPA provider's 
+        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 give back to the community :).  Then you
+        will need to tell <literal>seam</literal> to use it as before.
+        </para>
+        <programlisting role="XML"><![CDATA[<component name="org.jboss.seam.persistence.persistenceProvider" 
+           class="org.your.package.YourPersistenceProvider">
+</component>]]></programlisting> 
+        <para>All that is left is updating the <literal>persistence.xml</literal>
+            file with the correct provider class, and what ever properties your
+            provider 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: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml	2008-03-27 18:09:46 UTC (rev 7724)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml	2008-03-28 00:44:23 UTC (rev 7725)
@@ -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.  If you must use a different JPA provider see
+            <link linkend="alt-jpa-providers">Using Alternate JPA Providers</link>.
         </para>
         
         <para>




More information about the seam-commits mailing list