[jboss-svn-commits] JBL Code SVN: r15015 - in labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action: lib and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 11 09:34:51 EDT 2007


Author: tcunning
Date: 2007-09-11 09:34:50 -0400 (Tue, 11 Sep 2007)
New Revision: 15015

Added:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/quickstart-ds.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/src/hsqldb/
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/src/hsqldb/create.sql
Removed:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/lib/ext/
Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml
Log:
bug:JBESB-996
Convert quickstarts to use hsqldb rather than mysql.


Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml	2007-09-11 13:09:12 UTC (rev 15014)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml	2007-09-11 13:34:50 UTC (rev 15015)
@@ -6,9 +6,8 @@
 		${line.separator}
 	</description>
 	
-	<property name="additional.deploys" value="lib/*.jar" />
+	<property name="additional.deploys" value="jbossesb-service.xml" />
 	
-	
 	<!-- Import the base Ant build script... -->
 	<import file="../conf/base-build.xml"/>
 
@@ -28,7 +27,8 @@
 	</target>
 
 	<target name="undeploy" depends="dependencies">
-		<delete file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.ear"/>
+		<delete file="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.esb"/>
+		<delete file="${org.jboss.esb.server.deploy.dir}/quickstart-ds.xml"/>
 	</target>
 
 	<target name="config" depends="compile">
@@ -63,9 +63,6 @@
 			webxml="${basedir}/resources/WEB-INF/web.xml">                        		<fileset dir="${basedir}/view">
 				<include name="**/*"/>
 			</fileset>
-			<lib dir="${basedir}/lib/ext">
-				<include name="mysql-connector-java-3.1.12-bin.jar"/>
-			</lib>
 		</war>
 
 		<!-- We build the .esb in a custom manner because
@@ -84,56 +81,25 @@
 			</fileset>
 		</jar>	
 	</target>
-  
-	<target name="dropdb" 
-		description="drop database">
-		<echo>Drop database</echo>
-		<exec executable="mysql" >
-	  		<arg value="--user=root" />
-	  		<arg value="--password=" />
-	  		<arg value="--execute=drop database orders" />
-		</exec>
-	</target>  
 
-	<target name="createdb" depends="config, dropdb"
-		description="createdb">
-		<echo>Create database and test table</echo>
-                <exec executable="mysql" input="create.sql" >
-                        <arg value="--user=root" />
-                        <arg value="--password=" />
-                </exec>
-		<!--
-		<taskdef name="htools"
-		classname="org.hibernate.tool.ant.HibernateToolTask"
-		classpathref="hibernate-classpath"/>
-		<htools destdir="${basedir}">
-		<classpath refid="hibernate-classpath"/>
-		<configuration
-			configurationfile="hibernate.cfg.xml"/>
-		<hbm2ddl drop="true" outputfilename="sample.sql"/>
-		</htools>	
-		-->
-	</target>  
-
-	<target name="purgetable"
-		description="purgetable">
-		<echo>Purge sql table polled by gateway</echo>
-		<exec executable="mysql">
-			<arg value="--user=root" />
-			<arg value="--password=" />
-			<arg value="--database=orders" />
-			<arg value="--execute=delete from orders" />
-		</exec>
-	</target>  
-
-	<target name="select"
-		description="select * from orders">
+	<target name="select" depends="dependencies" description="select * from gateway_table">
+		<property name="hsqldb.jar" 
+			value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/lib/hsqldb.jar"/>
 		<echo>Select * from orders</echo>
-		<exec executable="mysql" >
-			<arg value="--user=root" />
-	  		<arg value="--password=" />
-	  		<arg value="--database=orders" />
-	  		<arg value="--execute=select * from orders" />
-	  	</exec>
+		<sql	
+			print="true"
+			driver="org.hsqldb.jdbcDriver"
+			url="jdbc:hsqldb:hsql://localhost:1703"
+			userid="sa"
+			autocommit="true"
+			password="">
+			<classpath>
+				<pathelement path="${hsqldb.jar}"/>
+			</classpath>
+			<transaction>
+			select * from orders
+			</transaction>
+			</sql>
 	</target>  
+
 </project>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql	2007-09-11 13:09:12 UTC (rev 15014)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql	2007-09-11 13:34:50 UTC (rev 15015)
@@ -1,10 +0,0 @@
-create database orders;
-use orders;
-create table orders
-(
-unique_id serial,
-product text,
-quantity int,
-price float
-);
-create unique index uid_index on orders (unique_id);

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml	2007-09-11 13:09:12 UTC (rev 15014)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml	2007-09-11 13:34:50 UTC (rev 15015)
@@ -4,13 +4,13 @@
 "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 <hibernate-configuration>
 <session-factory>
-      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
-      <property name="hibernate.connection.url">jdbc:mysql://localhost/orders</property>
-      <property name="hibernate.connection.username">root</property>
+      <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+      <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:1703</property>
+      <property name="hibernate.connection.username">sa</property>
       <property name="hibernate.connection.password"></property>
       <property name="hibernate.connection.pool_size">10</property>
       <property name="show_sql">true</property>
-      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
+      <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
       <property name="hibernate.hbm2ddl.auto">update</property>
       <property name="current_session_context_class">thread</property>
 <!--      <property name="hibernate.session_factory_name">java:comp/env/hibernate/SessionFactory</property> -->

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-service.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-service.xml	2007-09-11 13:34:50 UTC (rev 15015)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+   <mbean code="org.jboss.internal.soa.esb.dependencies.DatabaseInitializer"
+       name="jboss.esb:service=QuickstartDatabaseInitializer">
+      <attribute name="Datasource">java:/QuickstartDB</attribute>
+      <attribute name="ExistsSql">select * from orders</attribute>
+      <attribute name="SqlFiles">
+	hsqldb/create.sql
+      </attribute>
+      <depends>jboss.jca:name=QuickstartDB,service=DataSourceBinding</depends>
+   </mbean>
+</server>

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/quickstart-ds.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/quickstart-ds.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/quickstart-ds.xml	2007-09-11 13:34:50 UTC (rev 15015)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+   <local-tx-datasource>
+      <jndi-name>QuickstartDB</jndi-name>
+      <connection-url>jdbc:hsqldb:hsql://${jboss.bind.address}:1703</connection-url>
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+      <user-name>sa</user-name>
+      <password></password>
+      <min-pool-size>5</min-pool-size>
+      <max-pool-size>20</max-pool-size>
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+      <depends>jboss:service=Hypersonic</depends>	
+      <prepared-statement-cache-size>32</prepared-statement-cache-size>
+   </local-tx-datasource>
+
+   <!-- For hsqldb accessed from jboss only, in-process (standalone) mode -->
+   <mbean code="org.jboss.jdbc.HypersonicDatabase"
+     name="jboss:service=Hypersonic">
+     <attribute name="Port">1703</attribute>
+     <attribute name="BindAddress">${jboss.bind.address}</attribute> 
+     <attribute name="Database">quickstartDB</attribute>
+     <attribute name="Silent">true</attribute>
+     <attribute name="Trace">false</attribute>
+     <attribute name="No_system_exit">true</attribute>
+   </mbean>
+</datasources>

Added: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/src/hsqldb/create.sql	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/src/hsqldb/create.sql	2007-09-11 13:34:50 UTC (rev 15015)
@@ -0,0 +1,7 @@
+create table orders
+(
+unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+product VARCHAR(255) NOT NULL,
+quantity int,
+price float
+);




More information about the jboss-svn-commits mailing list