[jboss-cvs] JBossAS SVN: r82497 - in projects/ejb3/trunk/docs/tutorial: merge and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 23 03:12:30 EST 2008
Author: jaikiran
Date: 2008-12-23 03:12:30 -0500 (Tue, 23 Dec 2008)
New Revision: 82497
Added:
projects/ejb3/trunk/docs/tutorial/merge/
projects/ejb3/trunk/docs/tutorial/merge/META-INF/
projects/ejb3/trunk/docs/tutorial/merge/build.xml
projects/ejb3/trunk/docs/tutorial/merge/jndi.properties
projects/ejb3/trunk/docs/tutorial/merge/log4j.xml
projects/ejb3/trunk/docs/tutorial/merge/merge.html
projects/ejb3/trunk/docs/tutorial/merge/merge.wiki
projects/ejb3/trunk/docs/tutorial/merge/pom.xml
projects/ejb3/trunk/docs/tutorial/merge/src/
Removed:
projects/ejb3/trunk/docs/tutorial/merge/META-INF/
projects/ejb3/trunk/docs/tutorial/merge/build.xml
projects/ejb3/trunk/docs/tutorial/merge/jndi.properties
projects/ejb3/trunk/docs/tutorial/merge/log4j.xml
projects/ejb3/trunk/docs/tutorial/merge/merge.html
projects/ejb3/trunk/docs/tutorial/merge/merge.wiki
projects/ejb3/trunk/docs/tutorial/merge/src/
Modified:
projects/ejb3/trunk/docs/tutorial/merge/META-INF/persistence.xml
Log:
Initial working version of the Entity Merge tutorial, on JBoss-5 GA
Copied: projects/ejb3/trunk/docs/tutorial/merge (from rev 82032, projects/oldstuff/ejb3/docs/tutorial/merge)
Copied: projects/ejb3/trunk/docs/tutorial/merge/META-INF (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/META-INF)
Modified: projects/ejb3/trunk/docs/tutorial/merge/META-INF/persistence.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/META-INF/persistence.xml 2008-12-23 07:30:02 UTC (rev 82494)
+++ projects/ejb3/trunk/docs/tutorial/merge/META-INF/persistence.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,9 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<persistence>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+
<persistence-unit name="tempdb">
- <jta-data-source>java:/DefaultDS</jta-data-source>
- <properties>
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- </properties>
+ </properties>
+
</persistence-unit>
+
</persistence>
+
+
Deleted: projects/ejb3/trunk/docs/tutorial/merge/build.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/build.xml 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/merge/build.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- ======================================================================= -->
-<!-- JBoss build file -->
-<!-- ======================================================================= -->
-
-<project name="JBoss" default="ejbjar" basedir=".">
-
- <property environment="env"/>
- <property name="src.dir" value="${basedir}/src"/>
- <property name="jboss.home" value="${env.JBOSS_HOME}"/> <property name="jboss.server.config" value="all"/>
- <property name="build.dir" value="${basedir}/build"/>
- <property name="build.classes.dir" value="${build.dir}/classes"/>
-
- <!-- Build classpath -->
- <path id="classpath">
- <!-- So that we can get jndi.properties for InitialContext -->
- <pathelement location="${basedir}"/>
- <fileset dir="${jboss.home}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/ejb3.deployer">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/jboss-aop-jdk50.deployer">
- <include name="*.jar"/>
- </fileset>
- <pathelement location="${build.classes.dir}"/>
- </path>
-
- <property name="build.classpath" refid="classpath"/>
-
- <!-- =================================================================== -->
- <!-- Prepares the build directory -->
- <!-- =================================================================== -->
- <target name="prepare">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.classes.dir}"/>
- </target>
-
- <!-- =================================================================== -->
- <!-- Compiles the source code -->
- <!-- =================================================================== -->
- <target name="compile" depends="prepare">
- <javac srcdir="${src.dir}"
- destdir="${build.classes.dir}"
- debug="on"
- deprecation="on"
- optimize="off"
- includes="**">
- <classpath refid="classpath"/>
- </javac>
- </target>
-
- <target name="ejbjar" depends="compile">
- <jar jarfile="build/tutorial.jar">
- <fileset dir="${build.classes.dir}">
- <include name="**/*.class"/>
- </fileset>
- <fileset dir=".">
- <include name="META-INF/persistence.xml"/>
- </fileset>
- </jar>
- <copy file="build/tutorial.jar" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
- </target>
-
- <target name="run" depends="ejbjar">
- <java classname="org.jboss.tutorial.merge.client.Client" fork="yes" dir=".">
- <classpath refid="classpath"/>
- </java>
- </target>
-
- <!-- =================================================================== -->
- <!-- Cleans up generated stuff -->
- <!-- =================================================================== -->
- <target name="clean.db">
- <delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
- </target>
-
- <target name="clean">
- <delete dir="${build.dir}"/>
- <delete file="${jboss.home}/server/${jboss.server.config}/deploy/tutorial.jar"/>
- </target>
-
-
-</project>
-
Copied: projects/ejb3/trunk/docs/tutorial/merge/build.xml (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/build.xml)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/build.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/build.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+
+<!-- ======================================================================= -->
+<!-- JBoss build file -->
+<!-- ======================================================================= -->
+
+<project name="JBoss" default="ejbjar" basedir=".">
+
+ <property environment="env"/>
+ <property name="src.dir" value="${basedir}/src"/>
+ <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+ <property name="jboss.server.config" value="default"/>
+ <property name="build.dir" value="${basedir}/build"/>
+ <property name="build.classes.dir" value="${build.dir}/classes"/>
+ <property name="build.artifact" value="jboss-ejb3-tutorial-entity-merge.jar"/>
+
+ <!-- Build classpath -->
+ <path id="classpath">
+ <!-- So that we can get jndi.properties for InitialContext -->
+ <pathelement location="${basedir}"/>
+ <!-- Only the jbossall-client.jar should ideally be sufficient -->
+ <fileset dir="${jboss.home}/client">
+ <include name="**/jbossall-client.jar"/>
+ </fileset>
+ <pathelement location="${build.classes.dir}"/>
+ </path>
+
+ <property name="build.classpath" refid="classpath"/>
+
+ <!-- =================================================================== -->
+ <!-- Prepares the build directory -->
+ <!-- =================================================================== -->
+ <target name="prepare">
+ <mkdir dir="${build.dir}"/>
+ <mkdir dir="${build.classes.dir}"/>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Compiles the source code -->
+ <!-- =================================================================== -->
+ <target name="compile" depends="prepare">
+ <javac srcdir="${src.dir}"
+ destdir="${build.classes.dir}"
+ debug="on"
+ deprecation="on"
+ optimize="off"
+ includes="**">
+ <classpath refid="classpath"/>
+ </javac>
+ </target>
+
+ <target name="ejbjar" depends="compile">
+ <jar jarfile="build/${build.artifact}">
+ <fileset dir="${build.classes.dir}">
+ <include name="**/*.class"/>
+ </fileset>
+ <fileset dir=".">
+ <include name="META-INF/persistence.xml"/>
+ </fileset>
+ </jar>
+ <copy file="build/${build.artifact}" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
+ </target>
+
+ <target name="run" depends="ejbjar">
+ <java classname="org.jboss.tutorial.merge.client.Client" fork="yes" dir=".">
+ <classpath refid="classpath"/>
+ </java>
+ </target>
+
+ <!-- =================================================================== -->
+ <!-- Cleans up generated stuff -->
+ <!-- =================================================================== -->
+ <target name="clean.db">
+ <delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.dir}"/>
+ <delete file="${jboss.home}/server/${jboss.server.config}/deploy/${build.artifact}.jar"/>
+ </target>
+
+
+</project>
+
Deleted: projects/ejb3/trunk/docs/tutorial/merge/jndi.properties
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/jndi.properties 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/merge/jndi.properties 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,3 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
-java.naming.provider.url=localhost
Copied: projects/ejb3/trunk/docs/tutorial/merge/jndi.properties (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/jndi.properties)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/jndi.properties (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/jndi.properties 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,3 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+java.naming.provider.url=localhost
Deleted: projects/ejb3/trunk/docs/tutorial/merge/log4j.xml
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/log4j.xml 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/merge/log4j.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id$ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="INFO"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Messagen -->
- <!--
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
- -->
- <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) -%m%n"/>
- </layout>
-</appender>
-
- <root>
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</log4j:configuration>
Copied: projects/ejb3/trunk/docs/tutorial/merge/log4j.xml (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/log4j.xml)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/log4j.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/log4j.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id$ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="INFO"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Messagen -->
+ <!--
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ -->
+ <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L) -%m%n"/>
+ </layout>
+</appender>
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Deleted: projects/ejb3/trunk/docs/tutorial/merge/merge.html
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/merge.html 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/merge/merge.html 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,85 +0,0 @@
-<html>
-<body>
-<p>
-<h2>Merging and Basic Queries</h2>
-
-This example shows a bunch of things. First, it introduces the <tt>@Column</tt> annotation. It also shows how entities can be detached and reattached to persistence storage using the <tt>EntityManager.merge()</tt>. It also shows some basic queries.
-</p><p>
-<h4>@Column</h4>
-
-EJB 3.0 has a complete Object/Relational mapping. You can use the <tt>@Column</tt> annotation to specify which column in the table your property should map to.
-</p><p>
-Take a look at the <a href="src/org/jboss/tutorial/merge/bean/Customer.java">Customer</a> entity.
-</p><p>
-<pre>
- @Column(name = "FIRST")
- public String getFirst()
- {
- return first;
- }
-</pre>
-</p><p>
-<h4>Find by primary key</h4>
-
-The <tt>EntityManager</tt> service has a built in find by primary key method: <tt><T> find(Class<T>, Object pk)</tt>. The <a href="src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java">CustomerDAOBean</a> stateless EJB's <tt>find()</tt> method wrapps remote calls to the EntityManager.
-</p><p>
-<pre>
- public Customer find(int id)
- {
- return manager.find(Customer.class, id);
- }
-</pre>
-</p><p>
-<h4>Queries</h4>
-
-<tt>EntityManager</tt> allows you to create query objects on the fly that can be reused over and over, or just one time. Also, queries also support named parameters now. The <a href="src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java">CustomerDAOBean</a> reflects this usage in the <tt>findByLastName</tt> method.
-</p><p>
-<pre>
- public List findByLastName(String name)
- {
- return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
- }
-</pre>
-</p><p>
-<h4>Merging</h4>
-
-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 <tt>EntityManager.merge()</tt> method. This is exactly what the <a href="src/org/jboss/tutorial/merge/client/Client.java">Client</a> does.
-</p><p>
-<h4>Building and Running</h4>
-
-To build and run the example, make sure you have <tt>ejb3.deployer</tt> installed in JBoss 4.0.x and have JBoss running. See the reference manual on how to install EJB 3.0.
-<pre>
-Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
-Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
-$ ant
-$ ant run
-
-run:
- [java] Create Bill Burke and Monica Smith
- [java] 2004-10-06 22:27:50,344 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
-rt: org/apache/axis/AxisFault
- [java] Bill and Monica get married
- [java] Get all the Burkes
- [java] There are now 2 Burkes
-</pre>
-</p><p>
-The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.
-</p><p>
-<h4>View the tables and rows</h4>
-
-You can view the tables created by JBoss by going to the <a href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB">Hypersonic SQL service</a>, scrolling down to the <tt>startDatabaseManager</tt> 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.
-</p><p>
-<h4>Jar structure</h4>
-
-EJB 3.0 beans must be packaged in a JAR file with the suffix <tt>.jar</tt>. Running the ant script above creates a JAR file within the deploy/ directory of JBoss. All that needs to be in that jar is your server-side class files and additionally, you will probably need to define a hibernate.properties file in the META-INF directory of the JAR. hibernate.properties is needed if you need to hook in a datasource other than JBoss's DefaultDS, or change the caching of Hibernate. See the EJB 3.0 reference manual and Hibernate reference manual for more details.f
-</p><p>
-</p><p>
-</p><p>
-</p><p>
-</p><p>
-</p><p>
-</p>
-</body>
-</html>
Copied: projects/ejb3/trunk/docs/tutorial/merge/merge.html (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/merge.html)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/merge.html (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/merge.html 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,85 @@
+<html>
+<body>
+<p>
+<h2>Merging and Basic Queries</h2>
+
+This example shows a bunch of things. First, it introduces the <tt>@Column</tt> annotation. It also shows how entities can be detached and reattached to persistence storage using the <tt>EntityManager.merge()</tt>. It also shows some basic queries.
+</p><p>
+<h4>@Column</h4>
+
+EJB 3.0 has a complete Object/Relational mapping. You can use the <tt>@Column</tt> annotation to specify which column in the table your property should map to.
+</p><p>
+Take a look at the <a href="src/org/jboss/tutorial/merge/bean/Customer.java">Customer</a> entity.
+</p><p>
+<pre>
+ @Column(name = "FIRST")
+ public String getFirst()
+ {
+ return first;
+ }
+</pre>
+</p><p>
+<h4>Find by primary key</h4>
+
+The <tt>EntityManager</tt> service has a built in find by primary key method: <tt><T> find(Class<T>, Object pk)</tt>. The <a href="src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java">CustomerDAOBean</a> stateless EJB's <tt>find()</tt> method wrapps remote calls to the EntityManager.
+</p><p>
+<pre>
+ public Customer find(int id)
+ {
+ return manager.find(Customer.class, id);
+ }
+</pre>
+</p><p>
+<h4>Queries</h4>
+
+<tt>EntityManager</tt> allows you to create query objects on the fly that can be reused over and over, or just one time. Also, queries also support named parameters now. The <a href="src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java">CustomerDAOBean</a> reflects this usage in the <tt>findByLastName</tt> method.
+</p><p>
+<pre>
+ public List findByLastName(String name)
+ {
+ return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
+ }
+</pre>
+</p><p>
+<h4>Merging</h4>
+
+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 <tt>EntityManager.merge()</tt> method. This is exactly what the <a href="src/org/jboss/tutorial/merge/client/Client.java">Client</a> does.
+</p><p>
+<h4>Building and Running</h4>
+
+To build and run the example, make sure you have <tt>ejb3.deployer</tt> installed in JBoss 4.0.x and have JBoss running. See the reference manual on how to install EJB 3.0.
+<pre>
+Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
+Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
+$ ant
+$ ant run
+
+run:
+ [java] Create Bill Burke and Monica Smith
+ [java] 2004-10-06 22:27:50,344 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
+rt: org/apache/axis/AxisFault
+ [java] Bill and Monica get married
+ [java] Get all the Burkes
+ [java] There are now 2 Burkes
+</pre>
+</p><p>
+The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.
+</p><p>
+<h4>View the tables and rows</h4>
+
+You can view the tables created by JBoss by going to the <a href="http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB">Hypersonic SQL service</a>, scrolling down to the <tt>startDatabaseManager</tt> 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.
+</p><p>
+<h4>Jar structure</h4>
+
+EJB 3.0 beans must be packaged in a JAR file with the suffix <tt>.jar</tt>. Running the ant script above creates a JAR file within the deploy/ directory of JBoss. All that needs to be in that jar is your server-side class files and additionally, you will probably need to define a hibernate.properties file in the META-INF directory of the JAR. hibernate.properties is needed if you need to hook in a datasource other than JBoss's DefaultDS, or change the caching of Hibernate. See the EJB 3.0 reference manual and Hibernate reference manual for more details.f
+</p><p>
+</p><p>
+</p><p>
+</p><p>
+</p><p>
+</p><p>
+</p>
+</body>
+</html>
Deleted: projects/ejb3/trunk/docs/tutorial/merge/merge.wiki
===================================================================
--- projects/oldstuff/ejb3/docs/tutorial/merge/merge.wiki 2008-12-04 08:31:45 UTC (rev 82032)
+++ projects/ejb3/trunk/docs/tutorial/merge/merge.wiki 2008-12-23 08:12:30 UTC (rev 82497)
@@ -1,71 +0,0 @@
-!!!Merging and Basic Queries
-This example shows a bunch of things. First, it introduces the {{@Column}} annotation. It also shows how entities can be detached and reattached to persistence storage using the {{EntityManager.merge()}}. It also shows some basic queries.
-
-!@Column
-EJB 3.0 has a complete Object/Relational mapping. You can use the {{@Column}} annotation to specify which column in the table your property should map to.
-
-Take a look at the [Customer|src/org/jboss/tutorial/merge/bean/Customer.java] entity.
-
-{{{
- @Column(name = "FIRST")
- public String getFirst()
- {
- return first;
- }
-}}}
-
-!Find by primary key
-The {{EntityManager}} service has a built in find by primary key method: {{<T> find(Class<T>, Object pk)}}. The [CustomerDAOBean|src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java] stateless EJB's {{find()}} method wrapps remote calls to the EntityManager.
-
-{{{
- public Customer find(int id)
- {
- return manager.find(Customer.class, id);
- }
-}}}
-
-!Queries
-{{EntityManager}} allows you to create query objects on the fly that can be reused over and over, or just one time. Also, queries also support named parameters now. The [CustomerDAOBean|src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java] reflects this usage in the {{findByLastName}} method.
-
-{{{
- public List findByLastName(String name)
- {
- return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
- }
-}}}
-
-!Merging
-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 {{EntityManager.merge()}} method. This is exactly what the [Client|src/org/jboss/tutorial/merge/client/Client.java] does.
-
-!Building and Running
-To build and run the example, make sure you have {{ejb3.deployer}} installed in JBoss 4.0.x and have JBoss running. See the reference manual on how to install EJB 3.0.
-{{{
-Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
-Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
-$ ant
-$ ant run
-
-run:
- [java] Create Bill Burke and Monica Smith
- [java] 2004-10-06 22:27:50,344 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
-rt: org/apache/axis/AxisFault
- [java] Bill and Monica get married
- [java] Get all the Burkes
- [java] There are now 2 Burkes
-}}}
-
-The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.
-
-!View the tables and rows
-You can view the tables created by JBoss by going to the [Hypersonic SQL service|http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB], scrolling down to the {{startDatabaseManager}} 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.
-
-!Jar structure
-EJB 3.0 beans must be packaged in a JAR file with the suffix {{.jar}}. Running the ant script above creates a JAR file within the deploy/ directory of JBoss. All that needs to be in that jar is your server-side class files and additionally, you will probably need to define a hibernate.properties file in the META-INF directory of the JAR. hibernate.properties is needed if you need to hook in a datasource other than JBoss's DefaultDS, or change the caching of Hibernate. See the EJB 3.0 reference manual and Hibernate reference manual for more details.f
-
-
-
-
-
-
Copied: projects/ejb3/trunk/docs/tutorial/merge/merge.wiki (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/merge.wiki)
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/merge.wiki (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/merge.wiki 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,71 @@
+!!!Merging and Basic Queries
+This example shows a bunch of things. First, it introduces the {{@Column}} annotation. It also shows how entities can be detached and reattached to persistence storage using the {{EntityManager.merge()}}. It also shows some basic queries.
+
+!@Column
+EJB 3.0 has a complete Object/Relational mapping. You can use the {{@Column}} annotation to specify which column in the table your property should map to.
+
+Take a look at the [Customer|src/org/jboss/tutorial/merge/bean/Customer.java] entity.
+
+{{{
+ @Column(name = "FIRST")
+ public String getFirst()
+ {
+ return first;
+ }
+}}}
+
+!Find by primary key
+The {{EntityManager}} service has a built in find by primary key method: {{<T> find(Class<T>, Object pk)}}. The [CustomerDAOBean|src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java] stateless EJB's {{find()}} method wrapps remote calls to the EntityManager.
+
+{{{
+ public Customer find(int id)
+ {
+ return manager.find(Customer.class, id);
+ }
+}}}
+
+!Queries
+{{EntityManager}} allows you to create query objects on the fly that can be reused over and over, or just one time. Also, queries also support named parameters now. The [CustomerDAOBean|src/org/jboss/tutorial/merge/bean/CustomerDAOBean.java] reflects this usage in the {{findByLastName}} method.
+
+{{{
+ public List findByLastName(String name)
+ {
+ return manager.createQuery("from Customer c where c.last = :name").setParameter("name", name).getResultList();
+ }
+}}}
+
+!Merging
+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 {{EntityManager.merge()}} method. This is exactly what the [Client|src/org/jboss/tutorial/merge/client/Client.java] does.
+
+!Building and Running
+To build and run the example, make sure you have {{ejb3.deployer}} installed in JBoss 4.0.x and have JBoss running. See the reference manual on how to install EJB 3.0.
+{{{
+Unix: $ export JBOSS_HOME=<where your jboss 4.0 distribution is>
+Windows: $ set JBOSS_HOME=<where your jboss 4.0 distribution is>
+$ ant
+$ ant run
+
+run:
+ [java] Create Bill Burke and Monica Smith
+ [java] 2004-10-06 22:27:50,344 INFO org.jboss.remoting.InvokerRegistry[main] - Failed to load soap remoting transpo
+rt: org/apache/axis/AxisFault
+ [java] Bill and Monica get married
+ [java] Get all the Burkes
+ [java] There are now 2 Burkes
+}}}
+
+The INFO message you can ignore. It will be fixed in later releases of JBoss 4.0.
+
+!View the tables and rows
+You can view the tables created by JBoss by going to the [Hypersonic SQL service|http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB], scrolling down to the {{startDatabaseManager}} 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.
+
+!Jar structure
+EJB 3.0 beans must be packaged in a JAR file with the suffix {{.jar}}. Running the ant script above creates a JAR file within the deploy/ directory of JBoss. All that needs to be in that jar is your server-side class files and additionally, you will probably need to define a hibernate.properties file in the META-INF directory of the JAR. hibernate.properties is needed if you need to hook in a datasource other than JBoss's DefaultDS, or change the caching of Hibernate. See the EJB 3.0 reference manual and Hibernate reference manual for more details.f
+
+
+
+
+
+
Added: projects/ejb3/trunk/docs/tutorial/merge/pom.xml
===================================================================
--- projects/ejb3/trunk/docs/tutorial/merge/pom.xml (rev 0)
+++ projects/ejb3/trunk/docs/tutorial/merge/pom.xml 2008-12-23 08:12:30 UTC (rev 82497)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+
+
+
+
+ <!-- Model Version -->
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.ejb3</groupId>
+ <artifactId>jboss-ejb3-tutorial-common</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../common/</relativePath>
+ </parent>
+
+ <properties>
+ <ejb3.tutorial.client>org.jboss.tutorial.merge.client.Client</ejb3.tutorial.client>
+ </properties>
+
+
+ <artifactId>jboss-ejb3-tutorial-entity-merge</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>EJB3.0 Merging of Entities Tutorial</name>
+ <url>http://labs.jboss.com/jbossejb3/</url>
+ <description>
+ Tutorial explaining how entities can be merged in EJB3
+ </description>
+
+
+
+
+
+
+</project>
Property changes on: projects/ejb3/trunk/docs/tutorial/merge/pom.xml
___________________________________________________________________
Name: svn:executable
+ *
Copied: projects/ejb3/trunk/docs/tutorial/merge/src (from rev 82494, projects/oldstuff/ejb3/docs/tutorial/merge/src)
More information about the jboss-cvs-commits
mailing list