camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1170077 - in /camel/trunk: components/camel-jpa/pom.xml components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java parent/pom.xml platforms/karaf/features/src/main/resources/features.xml pom.xml
Date Tue, 13 Sep 2011 08:18:08 GMT
Author: davsclaus
Date: Tue Sep 13 08:18:08 2011
New Revision: 1170077

URL: http://svn.apache.org/viewvc?rev=1170077&view=rev
Log:
CAMEL-3742: Upgraded camel-jpa to JPA2 spec. Thanks to Ioannis for the patch.

Modified:
    camel/trunk/components/camel-jpa/pom.xml
    camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
    camel/trunk/parent/pom.xml
    camel/trunk/platforms/karaf/features/src/main/resources/features.xml
    camel/trunk/pom.xml

Modified: camel/trunk/components/camel-jpa/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/pom.xml (original)
+++ camel/trunk/components/camel-jpa/pom.xml Tue Sep 13 08:18:08 2011
@@ -66,8 +66,8 @@
       <artifactId>spring-orm</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.servicemix.specs</groupId>
-      <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jpa_2.0_spec</artifactId>
       <scope>provided</scope>
     </dependency> 
     <!-- testing -->
@@ -103,50 +103,28 @@
     </dependency>
   </dependencies>
 
-  <build>
-    <plugins>
-
-      <!-- lets enhance the classes for OpenJPA (shame it can't do it at runtime!) -->
-      <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-test-classes" />
-
-                <openjpac directory="${basedir}/target/jpa-test-classes">
-                  <classpath refid="cp" />
-                    <fileset dir="${basedir}/target/classes">
-                      <include name="org/apache/camel/processor/**/MessageProcessed.class"
/>
-                      <include name="org/apache/camel/processor/**/JpaTraceEventMessage.class"
/>
-                    </fileset>
-                  <config propertiesFile="${basedir}/src/test/resources/META-INF/persistence.xml"
/>
-                </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>
-
+    <build>
+        <plugins>
+            <!-- lets enhance the classes for OpenJPA (shame it can't do it at runtime!)
-->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>openjpa-maven-plugin</artifactId>
+                <version>1.2</version>
+                <configuration>
+                    <includes>org/apache/camel/examples/*.class</includes>
+                    <addDefaultConstructor>true</addDefaultConstructor>
+                    <enforcePropertyRestrictions>true</enforcePropertyRestrictions>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>enhancer</id>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>test-enhance</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 </project>

Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?rev=1170077&r1=1170076&r2=1170077&view=diff
==============================================================================
--- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
(original)
+++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
Tue Sep 13 08:18:08 2011
@@ -273,6 +273,11 @@ public class JpaConsumer extends Schedul
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Failed to achieve lock on entity: " + entity + ". Reason: " +
e, e);
             }
+            //TODO: Find if possible an alternative way to handle results of netive queries.
+            //Result of native queries are Arrays and cannot be locked by all JPA Providers.
+            if (entity.getClass().isArray()) {
+                return true;
+            }
             return false;
         }
     }

Modified: camel/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/parent/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
==============================================================================
--- camel/trunk/parent/pom.xml (original)
+++ camel/trunk/parent/pom.xml Tue Sep 13 08:18:08 2011
@@ -72,6 +72,7 @@
     <geronimo-j2ee-management-spec-version>1.1</geronimo-j2ee-management-spec-version>
     <geronimo-jms-spec-version>1.1.1</geronimo-jms-spec-version>
     <geronimo-jpa-spec-version>1.1.1</geronimo-jpa-spec-version>
+    <geronimo-jpa2-spec-version>1.1</geronimo-jpa2-spec-version>
     <geronimo-jsp-spec-version>1.0.1</geronimo-jsp-spec-version>
     <geronimo-jta-spec-version>1.1.1</geronimo-jta-spec-version>
     <geronimo-servlet-spec-version>1.1.1</geronimo-servlet-spec-version>
@@ -1016,6 +1017,11 @@
         <version>${geronimo-jpa-spec-version}</version>
       </dependency>
       <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jpa_2.0_spec</artifactId>
+        <version>${geronimo-jpa2-spec-version}</version>
+      </dependency>
+      <dependency>
         <groupId>org.apache.servicemix.specs</groupId>
         <artifactId>org.apache.servicemix.specs.java-persistence-api-1.1.1</artifactId>
         <version>${servicemix-specs-version}</version>

Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml
URL: http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
==============================================================================
--- camel/trunk/platforms/karaf/features/src/main/resources/features.xml (original)
+++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Tue Sep 13 08:18:08
2011
@@ -371,7 +371,7 @@
     <bundle>mvn:org.apache.camel/camel-josql/${pom.version}</bundle>
   </feature>
   <feature name='camel-jpa' version='${pom.version}' resolver='(obr)' start-level='50'>
-    <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.java-persistence-api-1.1.1/${servicemix-specs-version}</bundle>
+    <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo-jpa2-spec-version}</bundle>
     <feature version="[3,4)">spring-tx</feature>
     <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/${geronimo-el-version}</bundle>
     <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo-jta-spec-version}</bundle>
@@ -383,7 +383,7 @@
     <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/${ant-bundle-version}</bundle>
     <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp-bundle-version}</bundle>
     <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo-jms-spec-version}</bundle>
-    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.openjpa/${openjpa-bundle-version}</bundle>
+    <bundle>mvn:org.apache.openjpa/openjpa/${openjpa-version}</bundle>	
     <feature version="[3,4)">spring-orm</feature>
     <feature version='${pom.version}'>camel-core</feature>
     <bundle>mvn:org.apache.camel/camel-jpa/${pom.version}</bundle>

Modified: camel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=1170077&r1=1170076&r2=1170077&view=diff
==============================================================================
--- camel/trunk/pom.xml (original)
+++ camel/trunk/pom.xml Tue Sep 13 08:18:08 2011
@@ -49,7 +49,7 @@
     <jaxb-api-version>2.1</jaxb-api-version>
     <maven-bundle-version>2.3.5</maven-bundle-version>
 
-    <openjpa-version>1.2.2</openjpa-version>
+    <openjpa-version>2.1.1</openjpa-version>
   </properties>
 
   <mailingLists>



Mime
View raw message