You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2009/12/10 13:49:27 UTC

svn commit: r889245 - in /camel/trunk/components/camel-bam/src/test/profiles/eclipselink: ./ META-INF/ META-INF/persistence.xml META-INF/spring/ META-INF/spring/spring.xml log4j.properties

Author: cmoulliard
Date: Thu Dec 10 12:49:26 2009
New Revision: 889245

URL: http://svn.apache.org/viewvc?rev=889245&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/test/profiles/eclipselink/
    camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/
    camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/persistence.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/
    camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/spring.xml   (with props)
    camel/trunk/components/camel-bam/src/test/profiles/eclipselink/log4j.properties   (with props)

Added: camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/persistence.xml?rev=889245&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/persistence.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/persistence.xml Thu Dec 10 12:49:26 2009
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Copyright 2006 The Apache Software Foundation. Licensed 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.
+	-->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
+
+	<persistence-unit name="bam" transaction-type="RESOURCE_LOCAL">
+		<class>org.apache.camel.bam.model.ActivityDefinition</class>
+		<class>org.apache.camel.bam.model.ActivityState</class>
+		<class>org.apache.camel.bam.model.ProcessDefinition</class>
+		<class>org.apache.camel.bam.model.ProcessInstance</class>
+
+		<properties>
+			<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
+			<property name="javax.persistence.jdbc.user" value="sa" />
+			<property name="javax.persistence.jdbc.password" value="" />
+			<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:camel_bam" />
+			<property name="eclipselink.logging.level" value="FINE" />
+			<property name="eclipselink.logging.file" value="target/camel-example-etl.log" />
+			<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
+			<property name="eclipselink.ddl-generation.output-mode"
+				value="database" />
+			<!-- <property name="eclipselink.logging.thread" value="false" />-->
+			<!-- <property name="eclipselink.logging.session" value="false" />-->
+			<!-- <property name="eclipselink.logging.exceptions" value="false" />-->
+		</properties>
+
+	</persistence-unit>
+</persistence>

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

Added: camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/spring.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/spring.xml?rev=889245&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/spring.xml (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/eclipselink/META-INF/spring/spring.xml Thu Dec 10 12:49:26 2009
@@ -0,0 +1,58 @@
+<?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>
+	-->
+	
+    <!-- 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>
+	-->
+	
+	<!-- EclipseLink adapter -->
+	<bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
+   		<property name="databasePlatform" value="org.eclipse.persistence.platform.database.HSQLPlatform" />
+   		<property name="showSql" value="true" />
+	</bean>
+	
+</beans>

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

Added: camel/trunk/components/camel-bam/src/test/profiles/eclipselink/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bam/src/test/profiles/eclipselink/log4j.properties?rev=889245&view=auto
==============================================================================
--- camel/trunk/components/camel-bam/src/test/profiles/eclipselink/log4j.properties (added)
+++ camel/trunk/components/camel-bam/src/test/profiles/eclipselink/log4j.properties Thu Dec 10 12:49:26 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/eclipselink/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native