[jboss-cvs] JBossAS SVN: r83137 - in projects/ejb3/trunk/docs/tutorial/guide/en: modules and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jan 21 02:34:21 EST 2009
Author: jaikiran
Date: 2009-01-21 02:34:21 -0500 (Wed, 21 Jan 2009)
New Revision: 83137
Added:
projects/ejb3/trunk/docs/tutorial/guide/en/modules/jca_inflow_quartz.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/tableperinheritance.xml
Modified:
projects/ejb3/trunk/docs/tutorial/guide/en/master.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/blob.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/cachedentity.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/callbacks.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/composite.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/dependency.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/ejb21_client_adaptors.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/embeddable.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/enterprise_app_ejb_injection.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/entity.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/extended_pc.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/injection.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/jboss_deployment_descriptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/joininheritance.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb_deployment_descriptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/reference21_30.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/relationships.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/resource_ref.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/secondary.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/security.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/service_deployment_descriptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/singleinheritance.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful_deployment_descriptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless_deployment_descriptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/timer.xml
Log:
More tutorials added to the guide
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/master.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/master.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/master.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -30,6 +30,10 @@
<!ENTITY cachedentity SYSTEM "modules/cachedentity.xml">
<!ENTITY enterprise_app_ejb_injection SYSTEM "modules/enterprise_app_ejb_injection.xml">
<!ENTITY reference21_30 SYSTEM "modules/reference21_30.xml">
+<!ENTITY service SYSTEM "modules/service.xml">
+<!ENTITY service_deployment_descriptor SYSTEM "modules/service_deployment_descriptor.xml">
+<!ENTITY jca_inflow_quartz SYSTEM "modules/jca_inflow_quartz.xml">
+<!ENTITY tableperinheritance SYSTEM "modules/tableperinheritance.xml">
<!ENTITY todo SYSTEM "modules/todo.xml">
]>
<book lang="en">
@@ -44,5 +48,5 @@
<title>Target Audience</title>
<para>This tutorial is meant for EJB3 application developers on JBoss Application Server. The tutorial walks you through the EJB 3.0 features and how they deploy to JBoss. Please check the <xref linkend="Installation">install guide</xref> for system requirements.</para>
</preface>
-&installing;&stateless;&stateful;&blob;&cachedentity;&callbacks;&composite;&dependency;&ejb21_client_adaptors;&embeddable;&enterprise_app_ejb_injection;&entity;&extended_pc;&injection;&interceptor;&jboss_deployment_descriptor;&jndibinding;&joininheritance;&mdb;&mdb_deployment_descriptor;&merge;&reference21_30;&relationships;&resource_ref;&secondary;&security;&singleinheritance;&stateful_deployment_descriptor;&stateless_deployment_descriptor;&timer;&todo;
+&installing;&stateless;&stateful;&blob;&cachedentity;&callbacks;&composite;&dependency;&ejb21_client_adaptors;&embeddable;&enterprise_app_ejb_injection;&entity;&extended_pc;&injection;&interceptor;&jboss_deployment_descriptor;&jca_inflow_quartz;&jndibinding;&joininheritance;&mdb;&mdb_deployment_descriptor;&merge;&reference21_30;&relationships;&resource_ref;&secondary;&security;&service;&service_deployment_descriptor;&singleinheritance;&stateful_deployment_descriptor;&stateless_deployment_descriptor;&tableperinheritance;&timer;&todo;
</book>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/blob.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/blob.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/blob.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -178,7 +178,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "blob" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/cachedentity.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/cachedentity.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/cachedentity.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -152,7 +152,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "cachedentity" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/callbacks.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/callbacks.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/callbacks.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -181,7 +181,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "callbacks" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/composite.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/composite.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/composite.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -156,7 +156,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "composite" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/dependency.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/dependency.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/dependency.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -47,7 +47,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "dependency" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/ejb21_client_adaptors.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/ejb21_client_adaptors.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/ejb21_client_adaptors.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -85,7 +85,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "ejb21_client_adaptors" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/embeddable.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/embeddable.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/embeddable.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -47,7 +47,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "embeddable" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/enterprise_app_ejb_injection.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/enterprise_app_ejb_injection.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/enterprise_app_ejb_injection.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -129,7 +129,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "enterprise_app_ejb_injection" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/entity.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/entity.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/entity.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -175,7 +175,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "entity" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/extended_pc.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/extended_pc.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/extended_pc.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -128,7 +128,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "extended_pc" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/injection.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/injection.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/injection.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -92,7 +92,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "injection" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -816,7 +816,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "interceptor" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/jboss_deployment_descriptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/jboss_deployment_descriptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/jboss_deployment_descriptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -63,7 +63,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "jboss_deployment_descriptor" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Added: projects/ejb3/trunk/docs/tutorial/guide/en/modules/jca_inflow_quartz.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/jca_inflow_quartz.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/jca_inflow_quartz.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -0,0 +1,138 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="Quartz scheduler integration">
+ <title>Quartz scheduler integration</title>
+
+ <para>
+ JBossAS comes bundled with Quartz integration packaged as a JCA Message-Inflow resource adapter <literal>quartz-ra.rar</literal>.
+ This integration allows you to schedule stateless or stateful quartz jobs and have the job be posted to a
+ Message Driven bean. The Quartz Resource Adapter creates a non-persistent scheduler. Jobs are created from
+ the information in the MDB's activation config spec.
+ <note>
+ <para>
+ Currently only cron jobs are allowed to be configured.
+ </para>
+ </note>
+ </para>
+
+ <para>
+ Take a look at the <literal>org.jboss.tutorial.jca_inflow_quartz.bean.AnnotatedQuartzMDBBean</literal>:
+ <programlisting>
+ <![CDATA[
+ at MessageDriven(activationConfig =
+{@ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/2 * * * * ?")})
+ at ResourceAdapter("quartz-ra.rar")
+public class AnnotatedQuartzMDBBean implements Job
+{
+...
+ ]]>
+ </programlisting>
+ This is a simple MDB that implements the <literal>org.quartz.Job</literal> interface. The <literal>cronTrigger</literal>
+ activation spec attribute is required. In this you specify a cron syntax as documented in the Quartz documentation.
+ The <literal>@org.jboss.ejb3.annotation.ResourceAdapter</literal> annotation is used to tell the EJB container which
+ resource adapter to use for the inflow implementation.
+
+ </para>
+
+ <sect5>
+ Using deployment descriptors :
+ <para>
+ Instead of using annotations, you can also use a deployment descriptor to configure the MDB for Quartz
+ integration. Take a look at <literal>META-INF/ejb-jar.xml</literal> and <literal>META-INF/jboss.xml</literal>
+ The ejb-jar.xml configures the <literal>cronTrigger</literal> through the <literal><activation-config></literal>
+ element:
+
+ <programlisting>
+ <![CDATA[
+<message-driven>
+ <ejb-name>ExampleMDB</ejb-name>
+ <ejb-class>org.jboss.tutorial.quartz.bean.QuartzMDBBean</ejb-class>
+ <transaction-type>Container</transaction-type>
+ <activation-config>
+ <activation-config-property>
+ <activation-config-property-name>cronTrigger</activation-config-property-name>
+ <activation-config-property-value>0/2 * * * * ?</activation-config-property-value>
+ </activation-config-property>
+
+
+ </activation-config>
+</message-driven>
+ ]]>
+ </programlisting>
+ The jboss.xml configures the <literal>resource-adapter-name</literal> :
+ <programlisting>
+ <![CDATA[
+<message-driven>
+ <ejb-name>ExampleMDB</ejb-name>
+ <resource-adapter-name>quartz-ra.rar</resource-adapter-name>
+</message-driven>
+ ]]>
+ </programlisting>
+ </para>
+
+ </sect5>
+
+ <sect5>
+
+Building and Running
+ <para>
+ <note>
+ <para>
+ To build and run the example, make sure you have installed JBoss 5.x.
+ See the <xref linkend="JBossAS5">installation section</xref> for details.
+ </para>
+ </note>
+ From the command prompt, move to the "jca_inflow_quartz" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ <sect5>
+ Ant Users:
+ </sect5>
+ <para>
+ Make sure the "default" server configuration of JBossAS-5.x is running
+ </para>
+ <programlisting>
+ <![CDATA[
+$ ant
+ ]]>
+ </programlisting>
+ This will deploy the jar into the JBossAS-5.x server ("default" configuration).
+
+ <sect5>
+ Maven Users:
+ </sect5>
+
+ <programlisting>
+$ mvn clean package
+ </programlisting>
+ This will create the jar in the <literal>target</literal> folder of the tutorial. Copy this jar to the deploy folder of JBossAS-5.x
+ </para>
+ </sect5>
+ <para>
+ On the server side when the application is deployed, you will notice these logs:
+
+ <programlisting>
+ <![CDATA[
+18:46:57,053 INFO [QuartzMDBBean] ************** JOB: job.4.1232457416127
+18:46:58,023 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:46:58,026 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:00,019 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:47:00,021 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:00,023 INFO [QuartzMDBBean] ************** JOB: job.4.1232457416127
+18:47:02,020 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:47:02,023 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:03,019 INFO [QuartzMDBBean] ************** JOB: job.4.1232457416127
+18:47:04,022 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:47:04,024 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:06,019 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:47:06,021 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:06,024 INFO [QuartzMDBBean] ************** JOB: job.4.1232457416127
+18:47:08,019 INFO [AnnotatedQuartzMDBBean] ************** here in annotated!!!!
+18:47:08,021 INFO [QuartzMDBBean] ************** JOB: job.2.1232457416077
+18:47:09,020 INFO [QuartzMDBBean] ************** JOB: job.4.1232457416127
+
+ ]]>
+ </programlisting>
+
+ </para>
+
+
+
+</chapter>
\ No newline at end of file
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -92,7 +92,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "jndibinding" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/joininheritance.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/joininheritance.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/joininheritance.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -112,7 +112,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "joininheritance" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -297,7 +297,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "mdb" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb_deployment_descriptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb_deployment_descriptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/mdb_deployment_descriptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -47,7 +47,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "mdb_deployment_descriptor" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -90,7 +90,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "merge" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/reference21_30.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/reference21_30.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/reference21_30.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -202,7 +202,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "reference21_30" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/relationships.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/relationships.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/relationships.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -89,7 +89,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "relationships" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/resource_ref.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/resource_ref.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/resource_ref.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -51,7 +51,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "resource_ref" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/secondary.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/secondary.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/secondary.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -42,7 +42,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "secondary" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/security.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/security.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/security.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -74,7 +74,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "security" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/service_deployment_descriptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/service_deployment_descriptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/service_deployment_descriptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -53,7 +53,7 @@
</note>
</para>
- <sect5>
+ <sect5>
Building and Running
<para>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/singleinheritance.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/singleinheritance.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/singleinheritance.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -91,7 +91,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "singleinheritance" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -57,7 +57,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "stateful" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful_deployment_descriptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful_deployment_descriptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateful_deployment_descriptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -85,7 +85,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "stateful_deployment_descriptor" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -56,7 +56,9 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ <para>
+ From the command prompt, move to the "stateless" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ </para>
<sect5>
Ant Users:
</sect5>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless_deployment_descriptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless_deployment_descriptor.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/stateless_deployment_descriptor.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -82,7 +82,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "stateless_deployment_descriptor" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
Added: projects/ejb3/trunk/docs/tutorial/guide/en/modules/tableperinheritance.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/tableperinheritance.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/tableperinheritance.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -0,0 +1,145 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="Table per Class inheritance in EJB3 Entities">
+ <title>Table per Class inheritance in EJB3 Entities</title>
+
+ <para>
+ The EJB3 specification allows you to define entities that inherit from one another. The inheritance
+ relationships can be reflected in queries as well. So, if you queried based on the base class, the
+ query is polymorphic.
+ </para>
+
+ <para>
+ This tutorial uses the table per class strategy to map an inheritance relationship of
+ <literal>org.jboss.tutorial.tableperinheritance.bean.Pet</literal>, which is the base class for
+ <literal>org.jboss.tutorial.tableperinheritance.bean.Cat</literal> and <literal>org.jboss.tutorial.tableperinheritance.bean.Dog</literal>.
+ </para>
+
+ <para>
+ With the table per class strategy there is a table per class in the hierarchy, and each table has
+ every single property that particular class will persist.
+ </para>
+
+ <para>
+ This is what the annotations look like for Pet:
+
+ <programlisting>
+ <![CDATA[
+ at Entity
+ at Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
+public class Pet implements java.io.Serializable
+{
+
+...
+ ]]>
+ </programlisting>
+ The subclass annotations look like this:
+
+ <programlisting>
+ <![CDATA[
+ at Entity
+public class Dog extends Pet
+{
+...
+ ]]>
+
+ </programlisting>
+
+ </para>
+
+ <sect5>
+ Polymorphic Queries :
+ <para>
+ <literal>org.jboss.tutorial.tableperinheritance.bean.PetDAOBean</literal> stateless EJB wraps some polymorphic queries :
+ <programlisting>
+ <![CDATA[
+public List findByWeight(double weight)
+{
+ return manager.createQuery("from Pet p where p.weight < :weight").setParameter("weight", weight).getResultList();
+}
+
+ ]]>
+ </programlisting>
+ Even though the <literal>findByWeight</literal> method queries on Pet, either Dog or Cat instances can be returned.
+ </para>
+ </sect5>
+
+ <sect5>
+ Table Mapping :
+
+ <para>
+ The table mapping for this example looks like this:
+ <programlisting>
+ <![CDATA[
+create table CAT (
+ ID integer primary key,
+ LIVES int
+ NAME varchar,
+ WEIGHT double
+);
+
+create table DOG (
+ ID integer primary key,
+ NUMBONES int
+ NAME varchar,
+ WEIGHT double
+);
+
+ ]]>
+ </programlisting>
+ </para>
+ The table per class strategy is less efficient than the single table strategy as the SQL query is more complicated.
+ </sect5>
+
+ <sect5>
+
+Building and Running
+ <para>
+ <note>
+ <para>
+ To build and run the example, make sure you have installed JBoss 5.x.
+ See the <xref linkend="JBossAS5">installation section</xref> for details.
+ </para>
+ </note>
+ <important>
+ <para>
+ Because of a bug in HSQL, this tutorial does not work against the HSQL DB (which
+ JBoss ships by default). Till this is fixed, running the client is not possible.
+ Alternately, you can configure a datasource to use some other database and then
+ use that datasource in the persistence.xml
+ </para>
+ </important>
+ From the command prompt, move to the "tableperinheritance" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
+ <sect5>
+ Ant Users:
+ </sect5>
+ <para>
+ Make sure the "default" server configuration of JBossAS-5.x is running
+ </para>
+ <programlisting>
+ <![CDATA[
+$ ant
+ ]]>
+ </programlisting>
+
+ <sect5>
+ Maven Users: <xref linkend="Maven_Users_TODO">TODO</xref>
+ </sect5>
+
+ <programlisting>
+$ mvn clean install
+ </programlisting>
+
+ </para>
+ </sect5>
+ <sect5>
+ View the tables and rows:
+
+ <para>
+ You can view the tables created by JBoss by going to the
+ <ulink url="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB">Hypersonic Service</ulink>,
+ scrolling down to the <literal>startDatabaseManager</literal> button and clicking it.
+ A Hypersonic SQL window will be minimized, but you can open it up to look at the tables and do queries.
+
+ </para>
+ </sect5>
+</chapter>
\ No newline at end of file
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/timer.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/timer.xml 2009-01-21 06:59:14 UTC (rev 83136)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/timer.xml 2009-01-21 07:34:21 UTC (rev 83137)
@@ -46,7 +46,7 @@
See the <xref linkend="JBossAS5">installation section</xref> for details.
</para>
</note>
-
+ From the command prompt, move to the "timer" folder under the <xref linkend="EJB3_TUTORIAL_HOME">EJB3_TUTORIAL_HOME</xref>
<sect5>
Ant Users:
</sect5>
More information about the jboss-cvs-commits
mailing list