You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by gk...@apache.org on 2014/08/26 12:40:19 UTC
svn commit: r1620557 - in /turbine/core/trunk: ./ conf/test/ src/changes/
src/java/org/apache/turbine/services/schedule/ src/torque/schema/
Author: gk
Date: Tue Aug 26 10:40:19 2014
New Revision: 1620557
URL: http://svn.apache.org/r1620557
Log:
Upgrade to Torque 4 without removing Turbine Scheduler Service
- Same behaviour as before: generation of sql and scheduler ORM-classes.
- Generation of JobentryPeerImpl is done, but this class is not yet needed as JobEntryPeer is already used (replace?)
Added:
turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java (with props)
Modified:
turbine/core/trunk/conf/test/TorqueTest.properties
turbine/core/trunk/pom.xml
turbine/core/trunk/src/changes/changes.xml
turbine/core/trunk/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java
turbine/core/trunk/src/torque/schema/id-table-schema.xml
turbine/core/trunk/src/torque/schema/scheduler-schema.xml
Modified: turbine/core/trunk/conf/test/TorqueTest.properties
URL: http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/TorqueTest.properties?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/conf/test/TorqueTest.properties (original)
+++ turbine/core/trunk/conf/test/TorqueTest.properties Tue Aug 26 10:40:19 2014
@@ -27,8 +27,8 @@ torque.idbroker.usenewconnection=true
torque.database.default=default
torque.database.schema =
-torque.database.default.adapter=hypersonic
-
+# supported auto, hsqldb, mysql..
+torque.database.default.adapter=hsqldb
torque.dsfactory.default.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
Modified: turbine/core/trunk/pom.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/pom.xml?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/pom.xml (original)
+++ turbine/core/trunk/pom.xml Tue Aug 26 10:40:19 2014
@@ -522,94 +522,255 @@
<plugin>
<groupId>org.apache.torque</groupId>
<artifactId>torque-maven-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <targetDatabase>mysql</targetDatabase>
- <schemaDir>src/torque/schema</schemaDir>
- </configuration>
+ <version>4.0</version>
<executions>
- <execution>
- <id>torque-om</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>om</goal>
- </goals>
- <configuration>
- <targetPackage>org.apache.turbine.services.security.torque.om</targetPackage>
- <correctGetters>true</correctGetters>
- <baseOutputDir>${project.build.directory}/generated-sources/torque</baseOutputDir>
- <outputDir>${project.build.sourceDirectory}</outputDir>
- <reportFile>../../target/torque/report.${project.artifact.artifactId}.om.generation</reportFile>
- <runOnlyOnSchemaChange>true</runOnlyOnSchemaChange>
- <enableJava5Features>true</enableJava5Features>
- </configuration>
- </execution>
- <execution>
- <id>torque-sql-mysql</id>
- <phase>package</phase>
- <goals>
- <goal>sql</goal>
- <goal>id-table-init-sql</goal>
- </goals>
- <configuration>
- <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
- <outputDir>${project.build.directory}/generated-sql/torque/mysql</outputDir>
- <targetDatabase>mysql</targetDatabase>
- </configuration>
- </execution>
- <execution>
- <id>torque-sql-derby</id>
- <phase>package</phase>
- <goals>
- <goal>sql</goal>
- <goal>id-table-init-sql</goal>
- </goals>
- <configuration>
- <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
- <outputDir>${project.build.directory}/generated-sql/torque/derby</outputDir>
- <targetDatabase>derby</targetDatabase>
- </configuration>
- </execution>
- <execution>
- <id>torque-sql-oracle</id>
- <phase>package</phase>
- <goals>
- <goal>sql</goal>
- <goal>id-table-init-sql</goal>
- </goals>
- <configuration>
- <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
- <outputDir>${project.build.directory}/generated-sql/torque/oracle</outputDir>
- <targetDatabase>oracle</targetDatabase>
- </configuration>
- </execution>
- <execution>
- <id>torque-sql-postgresql</id>
- <phase>package</phase>
- <goals>
- <goal>sql</goal>
- <goal>id-table-init-sql</goal>
- </goals>
- <configuration>
- <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
- <outputDir>${project.build.directory}/generated-sql/torque/postgresql</outputDir>
- <targetDatabase>postgresql</targetDatabase>
- </configuration>
- </execution>
- <execution>
- <id>torque-sql-mssql</id>
- <phase>package</phase>
- <goals>
- <goal>sql</goal>
- <goal>id-table-init-sql</goal>
- </goals>
- <configuration>
- <runOnlyOnSchemaChange>false</runOnlyOnSchemaChange>
- <outputDir>${project.build.directory}/generated-sql/torque/mssql</outputDir>
- <targetDatabase>mssql</targetDatabase>
- </configuration>
- </execution>
+ <execution>
+ <id>torque-om</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.om</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.om.package>org.apache.turbine.services.schedule</torque.om.package>
+ <torque.om.addGetByNameMethods>false</torque.om.addGetByNameMethods>
+ <torque.om.save.saveException>TorqueException</torque.om.save.saveException>
+ <torque.om.useIsForBooleanGetters>true</torque.om.useIsForBooleanGetters>
+ </options>
+ <outputDirMap>
+ <modifiable>${project.build.sourceDirectory}</modifiable>
+ </outputDirMap>
+ </configuration>
+ </execution>
+ <!-- database specific loaders -->
+ <execution>
+ <id>torque-sql-mysql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/mysql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>mysql</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-mysql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/mysql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>mysql</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>torque-sql-hsqldb</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>hsqldb</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-hsqldb</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/hsqldb</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>hsqldb</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>torque-sql-derby</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/derby</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>derby</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-derby</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/derby</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>derby</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>torque-sql-oracle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/oracle</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>oracle</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-oracle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/oracle</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>oracle</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>torque-sql-postgresql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/postgresql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>postgresql</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-postgresql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/postgresql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>postgresql</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>torque-sql-mssql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.sql</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/mssql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>error</loglevel>
+ <options>
+ <torque.database>mssql</torque.database>
+ </options>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-idtable-sql-mssql</id>
+ <phase>package</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <configuration>
+ <packaging>classpath</packaging>
+ <configPackage>org.apache.torque.templates.idtable</configPackage>
+ <sourceDir>${project.basedir}/src/torque/schema</sourceDir>
+ <defaultOutputDir>${project.build.directory}/generated-sql/torque/mssql</defaultOutputDir>
+ <defaultOutputDirUsage>none</defaultOutputDirUsage>
+ <loglevel>info</loglevel>
+ <options>
+ <torque.database>mssql</torque.database>
+ </options>
+ </configuration>
+ </execution>
</executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.torque</groupId>
+ <artifactId>torque-templates</artifactId>
+ <version>4.0</version>
+ </dependency>
+ </dependencies>
</plugin>
</plugins>
</build>
@@ -683,6 +844,12 @@
<type>jar</type>
</dependency>
<dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.8.3</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
<groupId>ecs</groupId>
<artifactId>ecs</artifactId>
<version>1.4.2</version>
@@ -750,7 +917,7 @@
<dependency>
<groupId>org.apache.torque</groupId>
<artifactId>torque-runtime</artifactId>
- <version>3.3</version>
+ <version>4.0</version>
<type>jar</type>
<exclusions>
<exclusion>
@@ -761,6 +928,14 @@
<groupId>avalon-logkit</groupId>
<artifactId>avalon-logkit</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -785,6 +960,12 @@
<version>2.2.1</version>
<type>jar</type>
<optional>true</optional>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.excalibur.containerkit</groupId>
@@ -832,6 +1013,12 @@
<artifactId>velocity</artifactId>
<version>1.7</version>
<type>jar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
Modified: turbine/core/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/changes/changes.xml?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/src/changes/changes.xml (original)
+++ turbine/core/trunk/src/changes/changes.xml Tue Aug 26 10:40:19 2014
@@ -25,6 +25,9 @@
<body>
<release version="4.0-M2" date="in Subversion">
+ <action type="update" dev="gk">
+ Update to Torque 4.0.0
+ </action>
<action type="add" dev="tv">
Add Annotation @TurbineActionEvent to annotate action methods
with arbitrary event names.
Added: turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java?rev=1620557&view=auto
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java (added)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java Tue Aug 26 10:40:19 2014
@@ -0,0 +1,19 @@
+package org.apache.turbine.services.schedule;
+
+
+/**
+ * Maps ResultSet rows into JobEntry objects.
+ *
+ * The skeleton for this class was autogenerated by Torque on:
+ *
+ * [Tue Aug 26 11:56:24 CEST 2014]
+ *
+ */
+public class JobEntryRecordMapper extends BaseJobEntryRecordMapper
+{
+ /** Serial version */
+ private static final long serialVersionUID = 1409046984524L;
+
+
+
+}
Propchange: turbine/core/trunk/src/java/org/apache/turbine/services/schedule/JobEntryRecordMapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: turbine/core/trunk/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java (original)
+++ turbine/core/trunk/src/java/org/apache/turbine/services/schedule/TurbineSchedulerService.java Tue Aug 26 10:40:19 2014
@@ -27,7 +27,7 @@ import javax.servlet.ServletConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.torque.TorqueException;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.criteria.Criteria;
import org.apache.turbine.services.InitializationException;
import org.apache.turbine.services.TurbineBaseService;
import org.apache.turbine.util.TurbineException;
@@ -185,7 +185,7 @@ public class TurbineSchedulerService
try
{
// First remove from DB.
- Criteria c = new Criteria().add(JobEntryPeer.JOB_ID, je.getPrimaryKey());
+ Criteria c = new Criteria().where(JobEntryPeer.JOB_ID, je.getPrimaryKey());
JobEntryPeer.doDelete(c);
// Remove from the queue.
Modified: turbine/core/trunk/src/torque/schema/id-table-schema.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/torque/schema/id-table-schema.xml?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/src/torque/schema/id-table-schema.xml (original)
+++ turbine/core/trunk/src/torque/schema/id-table-schema.xml Tue Aug 26 10:40:19 2014
@@ -17,8 +17,6 @@
specific language governing permissions and limitations
under the License.
-->
-<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_3.dtd">
-
<!-- ==================================================================== -->
<!-- -->
<!-- I D B R O K E R S C H E M A -->
@@ -28,10 +26,16 @@
<!-- ID_TABLE table used by the id broker mechanism in Torque. -->
<!-- ==================================================================== -->
<!-- @author: <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a> -->
-<!-- @version $Id: id-table-schema.xml 571796 2007-09-01 13:11:26Z tv $ -->
+<!-- @version $Id: id-table-schema.xml,v 1.2 2005/09/23 12:19:52 tvan Exp $ -->
<!-- ==================================================================== -->
-<database name="default">
+<database name="default"
+ defaultIdMethod="none"
+ xmlns="http://db.apache.org/torque/4.0/templates/database"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://db.apache.org/torque/4.0/templates/database
+ http://db.apache.org/torque/4.0/templates/database.xsd">
+
<table name="ID_TABLE" idMethod="idbroker">
<column name="ID_TABLE_ID" required="true" primaryKey="true" type="INTEGER"/>
<column name="TABLE_NAME" required="true" size="255" type="VARCHAR"/>
Modified: turbine/core/trunk/src/torque/schema/scheduler-schema.xml
URL: http://svn.apache.org/viewvc/turbine/core/trunk/src/torque/schema/scheduler-schema.xml?rev=1620557&r1=1620556&r2=1620557&view=diff
==============================================================================
--- turbine/core/trunk/src/torque/schema/scheduler-schema.xml (original)
+++ turbine/core/trunk/src/torque/schema/scheduler-schema.xml Tue Aug 26 10:40:19 2014
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
-<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database_3_3.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -34,10 +33,14 @@
<!-- ==================================================================== -->
<database name="default"
- package="org.apache.turbine.services.schedule"
- >
+ defaultIdMethod="none"
+ xmlns="http://db.apache.org/torque/4.0/templates/database"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://db.apache.org/torque/4.0/templates/database
+ http://db.apache.org/torque/4.0/templates/database.xsd">
- <table name="TURBINE_SCHEDULED_JOB" idMethod="idbroker" javaName="JobEntry" >
+
+ <table name="TURBINE_SCHEDULED_JOB" idMethod="idbroker" javaName="JobEntry">
<column name="JOB_ID" required="true" primaryKey="true" type="INTEGER"/>
<column name="SECOND" javaName="Second" default="-1"
required="true" type="INTEGER"/>