camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmoulli...@apache.org
Subject svn commit: r889238 - in /camel/trunk/components/camel-bam: ./ src/main/java/org/apache/camel/bam/ src/main/java/org/apache/camel/bam/model/ src/main/java/org/apache/camel/bam/processor/ src/test/java/org/apache/camel/bam/ src/test/profiles/derby/ src/...
Date Thu, 10 Dec 2009 12:42:14 GMT
Author: cmoulliard
Date: Thu Dec 10 12:42:12 2009
New Revision: 889238

URL: http://svn.apache.org/viewvc?rev=889238&view=rev
Log:
CAMEL-2273 - do not use fully qualified class name in JPA query but simple name or entity name, add annotation @MappedSuperclass, remove @Id @GeneratedValue for classes extending EntitySupport, create QueryUtils class to be able to get simple name of the class or annotation name of @Entity, add new profile for eclipseLink and create a spring.xml/log4j.log files for each profile

Added:
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/
    camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/
    camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/
    camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/
    camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties   (with props)
Modified:
    camel/trunk/components/camel-bam/pom.xml
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityDefinition.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityState.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/EntitySupport.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessDefinition.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/ActivityMonitorEngine.java
    camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/JpaBamProcessorSupport.java
    camel/trunk/components/camel-bam/src/test/java/org/apache/camel/bam/BamRouteTest.java
    camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml

Modified: camel/trunk/components/camel-bam/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/pom.xml?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/pom.xml (original)
+++ camel/trunk/components/camel-bam/pom.xml Thu Dec 10 12:42:12 2009
@@ -1,300 +1,308 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<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">
-
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.camel</groupId>
-    <artifactId>camel-parent</artifactId>
-    <version>2.2-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>camel-bam</artifactId>
-  <packaging>bundle</packaging>
-  <name>Camel :: BAM</name>
-  <description>Camel BAM support</description>
-
-  <properties>
-	<camel.osgi.export.pkg>org.apache.camel.bam.*</camel.osgi.export.pkg>
-  </properties>
-
-  <dependencies>
-
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-spring</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-orm</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.springframework</groupId>
-      <artifactId>spring-jdbc</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.geronimo.specs</groupId>
-      <artifactId>geronimo-jpa_3.0_spec</artifactId>
-    </dependency>
-
-    <!-- testing -->
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-test</artifactId>      
-      <scope>test</scope>
-    </dependency>   
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-juel</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-
-
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <forkMode>always</forkMode>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-
-  <profiles>
-
-    <profile>
-      <id>hibernate-hsqldb</id>
-      <build>
-        <testResources>
-          <testResource>
-            <directory>${basedir}/src/test/profiles/hibernate</directory>
-          </testResource>
-          <testResource>
-            <directory>${basedir}/src/test/resources</directory>
-          </testResource>
-        </testResources>
-      </build>
-      <dependencies>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate-entitymanager</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>hsqldb</groupId>
-          <artifactId>hsqldb</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-jta_1.1_spec</artifactId>
-          <version>${geronimo-spec-version}</version>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-    <profile>
-      <id>hibernate-derby</id>
-      <activation>
-        <activeByDefault>true</activeByDefault>
-      </activation>
-      <build>
-        <testResources>
-          <testResource>
-            <directory>${basedir}/src/test/profiles/derby</directory>
-          </testResource>
-          <testResource>
-            <directory>${basedir}/src/test/resources</directory>
-          </testResource>
-        </testResources>
-      </build>
-      <dependencies>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate-entitymanager</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.derby</groupId>
-          <artifactId>derby</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-jta_1.1_spec</artifactId>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-
-    <profile>
-      <id>mysql</id>
-      <build>
-        <testResources>
-          <testResource>
-            <directory>${basedir}/src/test/profiles/mysql</directory>
-          </testResource>
-          <testResource>
-            <directory>${basedir}/src/test/resources</directory>
-          </testResource>
-        </testResources>
-      </build>
-      <dependencies>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate-entitymanager</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate</artifactId>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>mysql</groupId>
-          <artifactId>mysql-connector-java</artifactId>
-          <version>5.1.6</version>
-          <scope>test</scope>
-        </dependency>
-        <dependency>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>geronimo-jta_1.1_spec</artifactId>
-          <version>${geronimo-spec-version}</version>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-
-    <profile>
-      <id>openjpa</id>
-      <build>
-        <testResources>
-          <testResource>
-            <directory>${basedir}/src/test/profiles/openjpa</directory>
-          </testResource>
-          <testResource>
-            <directory>${basedir}/src/test/resources</directory>
-          </testResource>
-        </testResources>
-
-        <!-- lets enhance the classes for OpenJPA (shame it can't do it at runtime!) -->
-        <plugins>
-
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-antrun-plugin</artifactId>
-
-            <executions>
-              <execution>
-                <phase>process-test-classes</phase>
-                <configuration>
-                  <tasks>
-                    <path id="cp">
-                      <path refid="maven.test.classpath" />
-                      <path refid="maven.compile.classpath" />
-                      <path refid="maven.dependency.classpath" />
-                    </path>
-                    <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask">
-                      <classpath refid="cp" />
-                    </taskdef>
-
-                    <mkdir dir="${basedir}/target/jpa-classes" />
-                    <openjpac directory="${basedir}/target/jpa-classes">
-                      <classpath refid="cp" />
-                      <fileset dir="${basedir}/target/classes">
-                        <include name="org/apache/camel/bam/model/*.class" />
-                      </fileset>
-                    </openjpac>
-                    <copy overwrite="true" todir="${basedir}/target/classes">
-                      <fileset dir="${basedir}/target/jpa-classes" />
-                    </copy>
-
-                    <!--
-                                    <mkdir dir="${basedir}/target/jpa-test-classes" />
-                                    <openjpac directory="${basedir}/target/jpa-test-classes">
-                                      <classpath refid="cp" />
-                                      <fileset dir="${basedir}/target/test-classes">
-                                        <include name="org/apache/camel/examples/*.class" />
-                                      </fileset>
-                                    </openjpac>
-                                    <copy overwrite="true" todir="${basedir}/target/test-classes">
-                                      <fileset dir="${basedir}/target/jpa-test-classes" />
-                                    </copy>
-                    -->
-                  </tasks>
-                </configuration>
-                <goals>
-                  <goal>run</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-
-        </plugins>
-      </build>
-
-      <dependencies>
-
-        <!-- mandatory dependency for the enhancer! -->
-        <dependency>
-          <groupId>org.apache.openjpa</groupId>
-          <artifactId>openjpa-persistence-jdbc</artifactId>
-          <!--<scope>test</scope>-->
-        </dependency>
-
-        <dependency>
-          <groupId>org.apache.derby</groupId>
-          <artifactId>derby</artifactId>
-          <scope>test</scope>
-        </dependency>
-      </dependencies>
-    </profile>
-  </profiles>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<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">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.camel</groupId>
+		<artifactId>camel-parent</artifactId>
+		<version>2.2-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>camel-bam</artifactId>
+	<packaging>bundle</packaging>
+	<name>Camel :: BAM</name>
+	<description>Camel BAM support</description>
+
+	<properties>
+		<camel.osgi.export.pkg>org.apache.camel.bam.*</camel.osgi.export.pkg>
+	</properties>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-core</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-spring</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-orm</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_3.0_spec</artifactId>
+		</dependency>
+
+		<!-- testing -->
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-juel</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+
+	<build>
+		<plugins>
+			<plugin>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<forkMode>always</forkMode>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<profiles>
+
+		<!--  Hibernate HSQL profile -->
+		<profile>
+			<id>hibernate-hsqldb</id>
+			<build>
+				<testResources>
+					<testResource>
+						<directory>${basedir}/src/test/profiles/hibernate</directory>
+					</testResource>
+				</testResources>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-entitymanager</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>hsqldb</groupId>
+					<artifactId>hsqldb</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.apache.geronimo.specs</groupId>
+					<artifactId>geronimo-jta_1.1_spec</artifactId>
+					<version>${geronimo-jta-spec-version}</version>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+		</profile>
+
+		<!--  Hibernate Derby profile -->
+		<profile>
+			<id>hibernate-derby</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<build>
+				<testResources>
+					<testResource>
+						<directory>${basedir}/src/test/profiles/derby</directory>
+					</testResource>
+				</testResources>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-entitymanager</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.apache.derby</groupId>
+					<artifactId>derby</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.apache.geronimo.specs</groupId>
+					<artifactId>geronimo-jta_1.1_spec</artifactId>
+					<version>${geronimo-jta-spec-version}</version>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+		</profile>
+
+		<!--  Mysql profile -->
+		<profile>
+			<id>mysql</id>
+			<build>
+				<testResources>
+					<testResource>
+						<directory>${basedir}/src/test/profiles/mysql</directory>
+					</testResource>
+				</testResources>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate-entitymanager</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.hibernate</groupId>
+					<artifactId>hibernate</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>mysql</groupId>
+					<artifactId>mysql-connector-java</artifactId>
+					<version>5.1.6</version>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.apache.geronimo.specs</groupId>
+					<artifactId>geronimo-jta_1.1_spec</artifactId>
+					<version>${geronimo-spec-version}</version>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+		</profile>
+
+		<!-- EclipseLink - HSQLDB -->
+		<profile>
+			<id>eclipselink</id>
+			<build>
+				<testResources>
+					<testResource>
+						<directory>${basedir}/src/test/profiles/eclipselink</directory>
+					</testResource>
+				</testResources>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.eclipse.persistence</groupId>
+					<artifactId>eclipselink</artifactId>
+					<version>2.0.0-SNAPSHOT</version>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>hsqldb</groupId>
+					<artifactId>hsqldb</artifactId>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+			<repositories>
+				<repository>
+					<id>Eclipse</id>
+					<url>http://eclipse.ialto.org/rt/eclipselink/maven.repo</url>
+				</repository>
+			</repositories>
+		</profile>
+
+		<!--  OpenJPA profile -->
+		<profile>
+			<id>openjpa</id>
+			<build>
+				<testResources>
+					<testResource>
+						<directory>${basedir}/src/test/profiles/openjpa</directory>
+					</testResource>
+				</testResources>
+				<resources>
+					<resource>
+						<directory>${basedir}/src/test/profiles/openjpa</directory>
+					</resource>
+				</resources>
+				<plugins>
+					<plugin>
+
+						<!-- Will enhance classes as we run in a non J2EE 5 env <plugin> -->
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>openjpa-maven-plugin</artifactId>
+						<executions>
+							<execution>
+								<id>JPA Enhance</id>
+								<phase>process-test-classes</phase>
+								<goals>
+									<goal>enhance</goal>
+								</goals>
+							</execution>
+						</executions>
+						<configuration>
+							<addDefaultConstructor>true</addDefaultConstructor>
+							<enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+			<dependencies>
+				<dependency>
+					<groupId>org.apache.openjpa</groupId>
+					<artifactId>openjpa</artifactId>
+					<!--
+						Can't be used as we have this error : Caused by:
+						<openjpa-1.2.1-r752877:753278 nonfatal general error>
+						org.apache.openjpa.persistence.PersistenceException: Constraint
+						already exists: UNQ_NAME in statement [CREATE TABLE
+						CAMEL_PROCESSDEFINITION (id BIGINT NOT NULL, name VARCHAR(255) NOT
+						NULL, PRIMARY KEY (id), CONSTRAINT UNQ_name UNIQUE (name))] and
+						solved in openJpa 3.0 <version>1.2.1</version>
+					-->
+					<version>1.3.0-SNAPSHOT</version>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>hsqldb</groupId>
+					<artifactId>hsqldb</artifactId>
+					<scope>test</scope>
+				</dependency>
+				<dependency>
+					<groupId>org.apache.derby</groupId>
+					<artifactId>derby</artifactId>
+					<scope>test</scope>
+				</dependency>
+			</dependencies>
+		</profile>
+	</profiles>
 </project>
+

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/ProcessBuilder.java Thu Dec 10 12:42:12 2009
@@ -29,15 +29,19 @@
 import org.apache.camel.bam.model.ProcessInstance;
 import org.apache.camel.bam.processor.ActivityMonitorEngine;
 import org.apache.camel.bam.processor.JpaBamProcessor;
+import org.apache.camel.bam.processor.JpaBamProcessorSupport;
 import org.apache.camel.bam.rules.ProcessRules;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.springframework.orm.jpa.JpaTemplate;
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.TransactionCallbackWithoutResult;
 import org.springframework.transaction.support.TransactionTemplate;
+import org.springframework.util.ClassUtils;
 
 import static org.apache.camel.util.ObjectHelper.notNull;
 
@@ -47,6 +51,7 @@
  * @version $Revision$
  */
 public abstract class ProcessBuilder extends RouteBuilder {
+    private static final transient Log LOG = LogFactory.getLog(ProcessBuilder.class);
     private static int processCounter;
     private JpaTemplate jpaTemplate;
     private TransactionTemplate transactionTemplate;
@@ -181,7 +186,7 @@
         params.put("name", activityName);
 
         List<ActivityDefinition> list = CastUtils.cast(jpaTemplate.findByNamedParams("select x from "
-            + ActivityDefinition.class.getName() + " x where x.processDefinition = :definition and x.name = :name", params));
+            + QueryUtils.getTypeName(ActivityDefinition.class) + " x where x.processDefinition = :definition and x.name = :name", params));
         if (!list.isEmpty()) {
             return list.get(0);
         } else {
@@ -198,7 +203,7 @@
         params.put("name", processName);
 
         List<ProcessDefinition> list = CastUtils.cast(jpaTemplate.findByNamedParams("select x from "
-            + ProcessDefinition.class.getName() + " x where x.name = :name", params));
+            + QueryUtils.getTypeName(ProcessDefinition.class) + " x where x.name = :name", params));
         if (!list.isEmpty()) {
             return list.get(0);
         } else {

Added: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java (added)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java Thu Dec 10 12:42:12 2009
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.bam;
+
+import javax.persistence.Entity;
+
+public final class QueryUtils {
+
+    private QueryUtils() {
+    }
+
+    public static String getTypeName(Class<?> clazz) {
+
+        if (clazz == null) {
+            return null;
+        } else {
+
+            // Check if we have a property name on the @Entity annotation
+            String name = getEntityName(clazz);
+
+            if (name != null) {
+                return name;
+            } else {
+                // Remove package name of the entity to be conform with JPA 1.0
+                // spec
+                return clazz.getSimpleName();
+            }
+
+        }
+    }
+
+    protected static String getEntityName(Class<?> clazz) {
+
+        Entity entity = clazz.getAnnotation(Entity.class);
+
+        // Check if the property name has been defined for Entity annotation
+        if (!entity.name().equals("")) {
+            return entity.name();
+        } else {
+            return null;
+        }
+
+    }
+
+}

Propchange: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/QueryUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityDefinition.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityDefinition.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityDefinition.java Thu Dec 10 12:42:12 2009
@@ -17,6 +17,7 @@
 package org.apache.camel.bam.model;
 
 import javax.persistence.CascadeType;
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.GeneratedValue;
@@ -30,26 +31,19 @@
  */
 @Entity
 @Table(
-    name = "CAMEL_ACTIVITYDEFINITION",
-    uniqueConstraints = @UniqueConstraint(columnNames = {"name"})
+    name = "CAMEL_ACTIVITYDEFINITION"
 )
 public class ActivityDefinition extends EntitySupport {
+    
     private String name;
     private ProcessDefinition processDefinition;
 
-    // This crap is required to work around a bug in hibernate
-    @Override
-    @Id
-    @GeneratedValue
-    public Long getId() {
-        return super.getId();
-    }
-
     @Override
     public String toString() {
         return "Activity[" + getId() + " name: " + getName() + "]";
     }
-
+    
+    @Column(unique = true) 
     public String getName() {
         return name;
     }

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityState.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityState.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityState.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ActivityState.java Thu Dec 10 12:42:12 2009
@@ -50,18 +50,9 @@
     private Integer receivedMessageCount = 0;
     private ActivityDefinition activityDefinition;
     private Date timeExpected;
-    @Temporal(TemporalType.TIME)
     private Date timeOverdue;
     private Integer escalationLevel = 0;
 
-    // This crap is required to work around a bug in hibernate
-    @Override
-    @Id
-    @GeneratedValue
-    public Long getId() {
-        return super.getId();
-    }
-
     @Override
     public String toString() {
         return "ActivityState[" + getId() + " on " + getProcessInstance() + " " + getActivityDefinition() + "]";

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/EntitySupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/EntitySupport.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/EntitySupport.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/EntitySupport.java Thu Dec 10 12:42:12 2009
@@ -18,12 +18,14 @@
 
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
 
 /**
  * A base class for persistent entities
  *
  * @version $Revision$
  */
+@MappedSuperclass
 public class EntitySupport {
     private Long id;
 

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessDefinition.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessDefinition.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessDefinition.java Thu Dec 10 12:42:12 2009
@@ -20,12 +20,14 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.Id;
 import javax.persistence.Table;
 import javax.persistence.UniqueConstraint;
 
+import org.apache.camel.bam.QueryUtils;
 import org.apache.camel.util.CastUtils;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.commons.logging.Log;
@@ -36,22 +38,13 @@
  * @version $Revision$
  */
 @Entity
-@Table(
-    name = "CAMEL_PROCESSDEFINITION",
-    uniqueConstraints = @UniqueConstraint(columnNames = {"name"})
-)
+@Table(name = "CAMEL_PROCESSDEFINITION")
 public class ProcessDefinition extends EntitySupport {
+
     private static final transient Log LOG = LogFactory.getLog(ProcessDefinition.class);
     private String name;
 
-    // This crap is required to work around a bug in hibernate
-    @Override
-    @Id
-    @GeneratedValue
-    public Long getId() {
-        return super.getId();
-    }
-
+    @Column(unique = true)
     public String getName() {
         return name;
     }
@@ -78,8 +71,8 @@
         Map<String, Object> params = new HashMap<String, Object>(1);
         params.put("processName", processName);
 
-        List<ProcessDefinition> list = CastUtils.cast(template.findByNamedParams("select x from "
-            + ProcessDefinition.class.getName() + " x where x.name = :processName", params));
+        List<ProcessDefinition> list = CastUtils.cast(template.findByNamedParams("select x from " + QueryUtils.getTypeName(ProcessDefinition.class)
+                                                                                 + " x where x.name = :processName", params));
         if (!list.isEmpty()) {
             return list.get(0);
         } else {

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/model/ProcessInstance.java Thu Dec 10 12:42:12 2009
@@ -35,14 +35,12 @@
 
 /**
  * Represents a single business process
- *
+ * 
  * @version $Revision$
  */
 @Entity
-@Table(
-    name = "CAMEL_PROCESSINSTANCE"
-)
-public class ProcessInstance  {
+@Table(name = "CAMEL_PROCESSINSTANCE")
+public class ProcessInstance {
     private ProcessDefinition processDefinition;
     private Collection<ActivityState> activityStates = new HashSet<ActivityState>();
     private String correlationKey;
@@ -66,7 +64,7 @@
         this.correlationKey = correlationKey;
     }
 
-    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE })
+    @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
     public ProcessDefinition getProcessDefinition() {
         return processDefinition;
     }
@@ -75,7 +73,7 @@
         this.processDefinition = processDefinition;
     }
 
-    @OneToMany(mappedBy = "processInstance", fetch = FetchType.LAZY, cascade = {CascadeType.ALL })
+    @OneToMany(mappedBy = "processInstance", fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
     public Collection<ActivityState> getActivityStates() {
         return activityStates;
     }
@@ -84,7 +82,6 @@
         this.activityStates = activityStates;
     }
 
-
     @Transient
     public boolean isStarted() {
         return timeStarted != null;
@@ -111,12 +108,13 @@
 
     public void setTimeCompleted(Date timeCompleted) {
         this.timeCompleted = timeCompleted;
-    }    // Helper methods
-    //-------------------------------------------------------------------------
+    } // Helper methods
+
+    // -------------------------------------------------------------------------
 
     /**
      * Returns the activity state for the given activity
-     *
+     * 
      * @param activityRules the activity to find the state for
      * @return the activity state or null if no state could be found for the
      *         given activity

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/ActivityMonitorEngine.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/ActivityMonitorEngine.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/ActivityMonitorEngine.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/ActivityMonitorEngine.java Thu Dec 10 12:42:12 2009
@@ -24,6 +24,7 @@
 import javax.persistence.LockModeType;
 import javax.persistence.PersistenceException;
 
+import org.apache.camel.bam.QueryUtils;
 import org.apache.camel.bam.model.ActivityState;
 import org.apache.camel.bam.rules.ProcessRules;
 import org.apache.camel.impl.ServiceSupport;
@@ -35,6 +36,7 @@
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.TransactionCallbackWithoutResult;
 import org.springframework.transaction.support.TransactionTemplate;
+import org.springframework.util.ClassUtils;
 
 /**
  * A timer engine to monitor for expired activities and perform whatever actions
@@ -80,7 +82,7 @@
                         params.put("timeNow", timeNow);
 
                         List<ActivityState> list = CastUtils.cast(template.findByNamedParams("select x from "
-                                + ActivityState.class.getName() + " x where x.timeOverdue < :timeNow", params));
+                                + QueryUtils.getTypeName(ActivityState.class) + " x where x.timeOverdue < :timeNow", params));
                         for (ActivityState activityState : list) {
                             fireExpiredEvent(activityState);
                         }

Modified: camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/JpaBamProcessorSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/JpaBamProcessorSupport.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/JpaBamProcessorSupport.java (original)
+++ camel/trunk/components/camel-bam/src/main/java/org/apache/camel/bam/processor/JpaBamProcessorSupport.java Thu Dec 10 12:42:12 2009
@@ -26,6 +26,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
 import org.apache.camel.Processor;
+import org.apache.camel.bam.QueryUtils;
 import org.apache.camel.bam.model.ProcessDefinition;
 import org.apache.camel.bam.rules.ActivityRules;
 import org.apache.camel.util.IntrospectionSupport;
@@ -114,6 +115,7 @@
     protected T loadEntity(Exchange exchange, Object key) throws Exception {
         LOCK.lock();
         try {
+            LOG.info(">> LoadEntity call");
             T entity = findEntityByCorrelationKey(key);
             if (entity == null) {
                 entity = createEntity(exchange, key);
@@ -190,6 +192,6 @@
     }
 
     protected String createFindByKeyQuery() {
-        return "select x from " + getEntityType().getName() + " x where x." + getKeyPropertyName() + " = :key";
+        return "select x from " + QueryUtils.getTypeName(getEntityType()) + " x where x." + getKeyPropertyName() + " = :key";
     }
 }

Modified: camel/trunk/components/camel-bam/src/test/java/org/apache/camel/bam/BamRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/java/org/apache/camel/bam/BamRouteTest.java?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/test/java/org/apache/camel/bam/BamRouteTest.java (original)
+++ camel/trunk/components/camel-bam/src/test/java/org/apache/camel/bam/BamRouteTest.java Thu Dec 10 12:42:12 2009
@@ -55,7 +55,7 @@
     }
 
     protected ClassPathXmlApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/camel/bam/spring.xml");
+        return new ClassPathXmlApplicationContext("META-INF/spring/spring.xml");
     }
 
     @Before

Added: camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml Thu Dec 10 12:42:12 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<property name="transactionManager">
+			<bean class="org.springframework.orm.jpa.JpaTransactionManager">
+				<property name="entityManagerFactory" ref="entityManagerFactory" />
+			</bean>
+		</property>
+	</bean>
+
+	<bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="entityManagerFactory"	class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+		<property name="persistenceUnitName" value="bam" />
+		<property name="jpaVendorAdapter" ref="jpaAdapter"/>
+	</bean>
+	
+	<!-- Hibernate addapter -->
+	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+		<property name="databasePlatform" value="org.hibernate.dialect.DerbyDialect" />
+	</bean>
+	
+</beans>

Propchange: camel/trunk/components/camel-bam/src/test/profiles/derby/META-INF/spring/spring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties Thu Dec 10 12:42:12 2009
@@ -0,0 +1,40 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=DEBUG, out
+
+# uncomment the next line to debug Camel
+#log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.apache.camel.bam=DEBUG
+
+log4j.logger.org.springframework=DEBUG
+log4j.logger.org.hibernate=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-bam-test.log
+log4j.appender.out.append=true

Propchange: camel/trunk/components/camel-bam/src/test/profiles/derby/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml Thu Dec 10 12:42:12 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<property name="transactionManager">
+			<bean class="org.springframework.orm.jpa.JpaTransactionManager">
+				<property name="entityManagerFactory" ref="entityManagerFactory" />
+			</bean>
+		</property>
+	</bean>
+
+	<bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="entityManagerFactory"	class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+		<property name="persistenceUnitName" value="bam" />
+		<property name="jpaVendorAdapter" ref="jpaAdapter"/>
+	</bean>
+	
+	<!-- Hibernate addapter -->
+	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+		<property name="databasePlatform" value="org.hibernate.dialect.HSQLDialect" />
+	</bean>
+	
+</beans>

Propchange: camel/trunk/components/camel-bam/src/test/profiles/hibernate/META-INF/spring/spring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties Thu Dec 10 12:42:12 2009
@@ -0,0 +1,40 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=DEBUG, out
+
+# uncomment the next line to debug Camel
+#log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.apache.camel.bam=DEBUG
+
+log4j.logger.org.springframework=DEBUG
+log4j.logger.org.hibernate=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-bam-test.log
+log4j.appender.out.append=true

Propchange: camel/trunk/components/camel-bam/src/test/profiles/hibernate/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml Thu Dec 10 12:42:12 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<property name="transactionManager">
+			<bean class="org.springframework.orm.jpa.JpaTransactionManager">
+				<property name="entityManagerFactory" ref="entityManagerFactory" />
+			</bean>
+		</property>
+	</bean>
+
+	<bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="entityManagerFactory"	class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+		<property name="persistenceUnitName" value="bam" />
+		<property name="jpaVendorAdapter" ref="jpaAdapter"/>
+	</bean>
+	
+	<!-- Hibernate addapter -->
+	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+		<property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" />
+	</bean>
+	
+</beans>

Propchange: camel/trunk/components/camel-bam/src/test/profiles/mysql/META-INF/spring/spring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties Thu Dec 10 12:42:12 2009
@@ -0,0 +1,40 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=DEBUG, out
+
+# uncomment the next line to debug Camel
+#log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.apache.camel.bam=DEBUG
+
+log4j.logger.org.springframework=DEBUG
+log4j.logger.org.hibernate=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-bam-test.log
+log4j.appender.out.append=true

Propchange: camel/trunk/components/camel-bam/src/test/profiles/mysql/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml?rev=889238&r1=889237&r2=889238&view=diff
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml (original)
+++ camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/persistence.xml Thu Dec 10 12:42:12 2009
@@ -25,10 +25,22 @@
     <class>org.apache.camel.bam.model.ProcessInstance</class>
 
     <properties>
+      
+      <!-- Derby DB 
       <property name="openjpa.ConnectionURL" value="jdbc:derby:target/bamTest;create=true"/>
       <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
-      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
-      <property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO"/>
+      <property name="openjpa.Log" value="DefaultLevel=INFO, Tool=INFO, Runtime=TRACE, SQL=TRACE"/>
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" /> 
+      -->
+      
+      <!--  HSQL DB -->
+      <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver" />
+	  <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:target/bamTest" />
+      <property name="openjpa.Log" value="commons"/>
+	  <property name="openjpa.ConnectionUserName" value="sa" />
+	  <property name="openjpa.ConnectionPassword" value="" />
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
+
     </properties>
   </persistence-unit>
 </persistence>

Added: camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml Thu Dec 10 12:42:12 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to You under the Apache License, Version
+		2.0 (the "License"); you may not use this file except in compliance
+		with the License. You may obtain a copy of the License at
+
+		http://www.apache.org/licenses/LICENSE-2.0 Unless required by
+		applicable law or agreed to in writing, software distributed under the
+		License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+		CONDITIONS OF ANY KIND, either express or implied. See the License for
+		the specific language governing permissions and limitations under the
+		License.
+	-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<property name="transactionManager">
+			<bean class="org.springframework.orm.jpa.JpaTransactionManager">
+				<property name="entityManagerFactory" ref="entityManagerFactory" />
+			</bean>
+		</property>
+	</bean>
+
+	<bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="entityManagerFactory"	class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
+		<property name="persistenceUnitName" value="bam" />
+		<property name="jpaVendorAdapter" ref="jpaAdapter"/>
+	</bean>
+	
+    <!-- OpenJPA addapter -->
+	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
+		<property name="databasePlatform" value="org.apache.openjpa.jdbc.sql.HSQLDictionary"/>
+		<property name="database" value="HSQL"/> 
+	</bean>
+</beans>

Propchange: camel/trunk/components/camel-bam/src/test/profiles/openjpa/META-INF/spring/spring.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties?rev=889238&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties Thu Dec 10 12:42:12 2009
@@ -0,0 +1,52 @@
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=DEBUG, out
+
+# uncomment the next line to debug Camel
+#log4j.logger.org.apache.camel=DEBUG
+log4j.logger.org.apache.camel.bam=DEBUG
+
+log4j.logger.org.springframework=DEBUG
+log4j.logger.org.hibernate=WARN
+
+# CONSOLE appender not used by default
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/camel-bam-test.log
+log4j.appender.out.append=true
+
+# OpenJPA - more info on http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/manual.html#ref_guide_logging
+log4j.category.openjpa.Tool=TRACE
+log4j.category.openjpa.Runtime=TRACE
+log4j.category.openjpa.Remote=WARN
+log4j.category.openjpa.DataCache=WARN
+log4j.category.openjpa.MetaData=WARN
+log4j.category.openjpa.Enhance=WARN
+log4j.category.openjpa.Query=WARN
+log4j.category.openjpa.jdbc.SQL=TRACE
+log4j.category.openjpa.jdbc.JDBC=WARN
+log4j.category.openjpa.jdbc.Schema=WARN

Propchange: camel/trunk/components/camel-bam/src/test/profiles/openjpa/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message