[jboss-cvs] JBossAS SVN: r82608 - 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
Mon Jan 5 05:53:19 EST 2009
Author: jaikiran
Date: 2009-01-05 05:53:19 -0500 (Mon, 05 Jan 2009)
New Revision: 82608
Added:
projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml
Modified:
projects/ejb3/trunk/docs/tutorial/guide/en/master.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml
projects/ejb3/trunk/docs/tutorial/guide/en/modules/todo.xml
Log:
Updated the todos and added the guide for Merge tutorial
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/master.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/master.xml 2009-01-05 10:18:01 UTC (rev 82607)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/master.xml 2009-01-05 10:53:19 UTC (rev 82608)
@@ -14,6 +14,7 @@
<!ENTITY jndibinding SYSTEM "modules/jndibinding.xml">
<!ENTITY mdb SYSTEM "modules/mdb.xml">
<!ENTITY mdb_deployment_descriptor SYSTEM "modules/mdb_deployment_descriptor.xml">
+<!ENTITY merge SYSTEM "modules/merge.xml">
<!ENTITY todo SYSTEM "modules/todo.xml">
]>
<book lang="en">
@@ -27,5 +28,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;&callbacks;&composite;&embeddable;&entity;&extended_pc;&injection;&interceptor;&jndibinding;&mdb;&mdb_deployment_descriptor;&todo;
+&installing;&stateless;&stateful;&blob;&callbacks;&composite;&embeddable;&entity;&extended_pc;&injection;&interceptor;&jndibinding;&mdb;&mdb_deployment_descriptor;&merge;&todo;
</book>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml 2009-01-05 10:18:01 UTC (rev 82607)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/interceptor.xml 2009-01-05 10:53:19 UTC (rev 82608)
@@ -751,7 +751,7 @@
InvocationContext :
<para>
As you have seen the <literal>@AroundInvoke</literal> annotated interceptor methods all take a parameter of type
- <literal>javax.ejb.InvocationContext</literal>. The definition of InvocationContext is:
+ <literal>javax.ejb.InvocationContext</literal>. The definition of <ulink url="http://java.sun.com/javaee/5/docs/api/javax/interceptor/InvocationContext.html">InvocationContext</ulink> is:
<programlisting>
<![CDATA[
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml 2009-01-05 10:18:01 UTC (rev 82607)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/jndibinding.xml 2009-01-05 10:53:19 UTC (rev 82608)
@@ -69,11 +69,6 @@
]]>
</programlisting>
- <note>
-
- <xref linkend="JNDIBinding">Not supported in JBossAS-5.0 GA</xref>
-
- </note>
</para>
</sect5>
Added: projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/merge.xml 2009-01-05 10:53:19 UTC (rev 82608)
@@ -0,0 +1,139 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter id="Merging and Basic Queries on entities">
+ <title>Introduction to merging and querying of entities in EJB3</title>
+ <para>
+ This example shows a bunch of things. First, it introduces the <literal>@Column</literal> annotation.
+ It also shows how entities can be detached and re-attached to persistence storage using the <literal>EntityManager.merge()</literal>.
+ It also shows some basic queries.
+
+ </para>
+ <sect5>
+ @Column :
+
+ <para>
+ EJB 3.0 has a complete Object/Relational mapping. You can use the <literal>@Column</literal> annotation to specify
+ which column in the table your property should map to. Take a look at the <literal>org.jboss.tutorial.merge.bean.Customer</literal>
+ entity.
+ <programlisting>
+ <![CDATA[
+ at Column(name = "FIRST")
+public String getFirst()
+{
+ return first;
+}
+
+ ]]>
+ </programlisting>
+
+ </para>
+ </sect5>
+
+ <sect5>
+ Find by primary key :
+ <para>
+ The <literal>EntityManager</literal> service has a built in find by primary key method:
+ <programlisting>
+ <![CDATA[
+<T> find(Class<T>, Object pk)
+ ]]>
+ </programlisting>
+ The <literal>org.jboss.tutorial.merge.bean.CustomerDAOBean</literal> stateless EJB's <literal>find()</literal> method
+ wraps remote calls to the EntityManager.
+ <programlisting>
+ <![CDATA[
+public Customer find(int id)
+{
+ return manager.find(Customer.class, id);
+}
+
+ ]]>
+ </programlisting>
+ </para>
+ </sect5>
+
+ <sect5>
+ Queries :
+ <para>
+ <literal>EntityManager</literal> allows you to create query objects on the fly that can be reused over and over,
+ or just one time. Queries also support named parameters. The <literal>org.jboss.tutorial.merge.bean.CustomerDAOBean</literal>
+ reflects this usage in the <literal>findByLastName</literal> method.
+ <programlisting>
+ <![CDATA[
+public List findByLastName(String name)
+{
+ return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
+}
+
+ ]]>
+ </programlisting>
+ </para>
+ </sect5>
+
+ <sect5>
+ Merging :
+ <para>
+ The Value Object pattern is built into EJB 3.0. You can detach an object from persistence storage and send it across
+ the network to the client. The client can make updates locally to the object, send it back to the server and the changes
+ can be merged/synchronized back to the database using the <literal>EntityManager.merge()</literal> method.
+ This is exactly what the <literal>org.jboss.tutorial.merge.client.Client</literal> does.
+
+ </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>
+
+ <sect5>
+ Ant Users:
+ </sect5>
+ <para>
+ Make sure your JBossAS-5.x is running
+ </para>
+ <programlisting>
+ <![CDATA[
+$ ant
+$ ant run
+
+run:
+ [java] Create Bill Burke and Monica Smith
+ [java] Bill and Monica get married
+ [java] Get all the Burkes
+ [java] There are now 2 Burkes
+
+
+
+ ]]>
+ </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>
Modified: projects/ejb3/trunk/docs/tutorial/guide/en/modules/todo.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/guide/en/modules/todo.xml 2009-01-05 10:18:01 UTC (rev 82607)
+++ projects/ejb3/trunk/docs/tutorial/guide/en/modules/todo.xml 2009-01-05 10:53:19 UTC (rev 82608)
@@ -12,35 +12,7 @@
</section>
- <section id="JNDIBinding">
- <title>TODO - Support for binding the EntityManager and EntityManagerFactory in JNDI</title>
- <para>
- JBoss-5.0 GA does NOT support binding the EntityManager and EntityManagerFactory in JNDI, using
- the following properties in persistence.xml:
-
- <programlisting>
- <![CDATA[
-<persistence>
- <persistence-unit name="manager1">
- ...
- <properties>
- <property name="jboss.entity.manager.jndi.name" value="java:/Manager1"/>
- <property name="jboss.entity.manager.factory.jndi.name" value="java:/Manager1Factory"/>
- </properties>
- </persistence-unit>
-</persistence>
-
- ]]>
- </programlisting>
- We are tracking this in our EJBTHREE JIRA.
- </para>
-
- </section>
- <section id="InvocationContext_Javadoc">
- <title>Point to the javadocs of InvocationContext in the "interceptor" tutorial guide</title>
- <para>
- Better point to javadocs instead of the listing the methods in the guide
- </para>
- </section>
+
+
</chapter>
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list