[seam-commits] Seam SVN: r7679 - branches/Seam_2_0/doc/Seam_Reference_Guide/en.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Mar 24 13:28:31 EDT 2008
Author: jbalunas at redhat.com
Date: 2008-03-24 13:28:31 -0400 (Mon, 24 Mar 2008)
New Revision: 7679
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-2761, JBSEAM-1946
Added a section on using alternate JPA providers.
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-23 01:21:04 UTC (rev 7678)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Configuration.xml 2008-03-24 17:28:31 UTC (rev 7679)
@@ -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 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: branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml
===================================================================
--- branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml 2008-03-23 01:21:04 UTC (rev 7678)
+++ branches/Seam_2_0/doc/Seam_Reference_Guide/en/Persistence.xml 2008-03-24 17:28:31 UTC (rev 7679)
@@ -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