db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1212604 - in /db/torque/torque4/trunk: torque-runtime/src/main/java/org/apache/torque/adapter/ torque-templates/src/main/java/org/apache/torque/templates/platform/ torque-templates/src/main/resources/org/apache/torque/templates/sql/created...
Date Fri, 09 Dec 2011 20:00:49 GMT
Author: tfischer
Date: Fri Dec  9 20:00:48 2011
New Revision: 1212604

URL: http://svn.apache.org/viewvc?rev=1212604&view=rev
Log:
Add hsqldb support

Added:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java
      - copied, changed from r1056939, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHypersonicSQL.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
      - copied, changed from r1103197, db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHypersonicImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/createdb.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/columnComment.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/databaseStart.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropForeignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropTable.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/index.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/primaryKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/tableComment.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/unique.vm
Removed:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHypersonicSQL.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHypersonicImpl.java
Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
    db/torque/torque4/trunk/torque-test/src/test/profile/hsqldb/Torque.properties

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java?rev=1212604&r1=1212603&r2=1212604&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBFactory.java
Fri Dec  9 20:00:48 2011
@@ -61,8 +61,8 @@ public final class DBFactory
         adapters.put("COM.ibm.db2.jdbc.net.DB2Driver", DBDB2Net.class);
         adapters.put("COM.cloudscape.core.JDBCDriver", DBCloudscape.class);
         adapters.put("org.firebirdsql.jdbc.FBDriver", DBFirebird.class);
-        adapters.put("org.hsql.jdbcDriver", DBHypersonicSQL.class);
-        adapters.put("org.hsqldb.jdbcDriver", DBHypersonicSQL.class);
+        adapters.put("org.hsql.jdbcDriver", DBHsqldb.class);
+        adapters.put("org.hsqldb.jdbcDriver", DBHsqldb.class);
         adapters.put("interbase.interclient.Driver", DBInterbase.class);
         adapters.put("org.enhydra.instantdb.jdbc.idbDriver", DBInstantDB.class);
         adapters.put("com.microsoft.jdbc.sqlserver.SQLServerDriver",
@@ -89,7 +89,7 @@ public final class DBFactory
         adapters.put("db2net", DBDB2Net.class);
         adapters.put("cloudscape", DBCloudscape.class);
         adapters.put("firebird", DBFirebird.class);
-        adapters.put("hypersonic", DBHypersonicSQL.class);
+        adapters.put("hsqldb", DBHsqldb.class);
         adapters.put("interbase", DBInterbase.class);
         adapters.put("instantdb", DBInstantDB.class);
         adapters.put("mssql", DBMSSQL.class);
@@ -113,7 +113,7 @@ public final class DBFactory
         adapters.put("DB2/SUN", DBDB2App.class);
         adapters.put("DB2/LINUX390", DBDB2App.class);
         adapters.put("DB2/AIX64", DBDB2App.class);
-        adapters.put("HSQL Database Engine", DBHypersonicSQL.class);
+        adapters.put("HSQL Database Engine", DBHsqldb.class);
         adapters.put("Microsoft SQL Server Database", DBMSSQL.class);
         adapters.put("Microsoft SQL Server", DBMSSQL.class);
         adapters.put("MySQL", DBMM.class);

Copied: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java
(from r1056939, db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHypersonicSQL.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java?p2=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java&p1=db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHypersonicSQL.java&r1=1056939&r2=1212604&rev=1212604&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHypersonicSQL.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/adapter/DBHsqldb.java
Fri Dec  9 20:00:48 2011
@@ -23,14 +23,14 @@ import java.sql.Connection;
 import java.sql.SQLException;
 
 /**
- * This is used to connect to Hypersonic SQL databases.
+ * This is used to connect to Hsqldb databases.
  *
  * <a href="http://hsqldb.org/">http://hsqldb.org/</a>
  *
  * @author <a href="mailto:celkins@scardini.com">Christopher Elkins</a>
  * @version $Id$
  */
-public class DBHypersonicSQL extends AbstractDBAdapter
+public class DBHsqldb extends AbstractDBAdapter
 {
     /**
      * Serial version
@@ -40,7 +40,7 @@ public class DBHypersonicSQL extends Abs
     /**
      * Constructor.
      */
-    protected DBHypersonicSQL()
+    protected DBHsqldb()
     {
     }
 
@@ -80,7 +80,7 @@ public class DBHypersonicSQL extends Abs
      */
     public String ignoreCaseInOrderBy(String in)
     {
-        return "CAST(" + in + " AS VARCHAR_IGNORECASE)";
+        return "CAST(" + in + " AS VARCHAR_IGNORECASE(10000))";
     }
 
     /**

Copied: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
(from r1103197, db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHypersonicImpl.java)
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java?p2=db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java&p1=db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHypersonicImpl.java&r1=1103197&r2=1212604&rev=1212604&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHypersonicImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
Fri Dec  9 20:00:48 2011
@@ -28,12 +28,12 @@ import org.apache.torque.templates.typem
  * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
  * @version $Id: PlatformHypersonicImpl.java 473814 2006-11-11 22:30:30 +0000 (Sat, 11 Nov
2006) tv $
  */
-public class PlatformHypersonicImpl extends PlatformDefaultImpl
+public class PlatformHsqldbImpl extends PlatformDefaultImpl
 {
     /**
      * Default constructor.
      */
-    public PlatformHypersonicImpl()
+    public PlatformHsqldbImpl()
     {
         super();
         initialize();
@@ -46,23 +46,10 @@ public class PlatformHypersonicImpl exte
     {
         setSchemaTypeToSqlTypeMapping(
                 SchemaType.CHAR,
-                new SqlType("VARCHAR"));
+                new SqlType("VARCHAR", "1"));
         setSchemaTypeToSqlTypeMapping(
                 SchemaType.BOOLEANCHAR,
-                new SqlType("VARCHAR"));
-        // TODO: should longvarchar not be mapped to LONGVARCHAR as CLOB ?
-        setSchemaTypeToSqlTypeMapping(
-                SchemaType.LONGVARCHAR,
-                new SqlType("VARCHAR"));
-        setSchemaTypeToSqlTypeMapping(
-                SchemaType.VARBINARY,
-                new SqlType("BINARY"));
-        setSchemaTypeToSqlTypeMapping(
-                SchemaType.BLOB,
-                new SqlType("BINARY"));
-        setSchemaTypeToSqlTypeMapping(
-                SchemaType.CLOB,
-                new SqlType("LONGVARCHAR"));
+                new SqlType("VARCHAR", "1"));
     }
 
     /**

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/createdb.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/createdb.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/hsqldb/createdb.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,17 @@
+## 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.
+-- generate databases for hsqldb : do nothing

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/columnComment.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/columnComment.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/columnComment.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/columnComment.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,17 @@
+## 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.
+## no Comments on columns in hsqldb

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/databaseStart.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/databaseStart.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/databaseStart.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/databaseStart.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,20 @@
+## 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.
+-- -----------------------------------------------------------------------
+-- $torqueGen.option("torque.database") SQL script for schema $name
+-- -----------------------------------------------------------------------
+

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropForeignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropForeignKey.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropForeignKey.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropForeignKey.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,20 @@
+## 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.
+ALTER TABLE $torqueGen.getParent().getAttribute("name")
+    DROP CONSTRAINT $name;
+
+

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropTable.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropTable.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropTable.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropTable.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,17 @@
+## 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.
+drop table $name;

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,29 @@
+## 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.
+ALTER TABLE $torqueGen.getParent().getAttribute("name")
+    ADD CONSTRAINT $name 
+    FOREIGN KEY ($localColumnNames)
+    REFERENCES $foreignTable ($foreignColumnNames)##
+#if ($onUpdate)
+
+    ON UPDATE $onUpdate##
+#end
+#if ($onDelete)
+
+    ON DELETE $onDelete##
+#end
+;

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/index.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/index.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/index.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/index.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,20 @@
+## 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.
+#set ( $tableName = $torqueGen.getParent().getAttribute("name") )
+#if ($indexColumnNames != "")
+CREATE INDEX#if($name) $name#end ON $tableName ($indexColumnNames);
+#end

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/primaryKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/primaryKey.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/primaryKey.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/primaryKey.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,19 @@
+## 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.
+#if ($primaryKeyColumnNames != "")
+    PRIMARY KEY($primaryKeyColumnNames),
+#end

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/table.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/table.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/table.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,34 @@
+## 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.
+
+-- -----------------------------------------------------------------------
+-- $name
+-- -----------------------------------------------------------------------
+CREATE TABLE $name
+(
+#set ( $cols = $torqueGen.mergepoint("columns") )
+#set ( $pk = $torqueGen.mergepoint("primaryKey") )
+#set ( $unique = $torqueGen.mergepoint("unique") )
+#set ( $createTableSql = "${cols}${pk}${unique}")
+#set ( $lastCommaPos = $createTableSql.lastIndexOf(","))
+#if ($lastCommaPos == -1)${createTableSql}#else${createTableSql.substring(0, $lastCommaPos)}#end
+)##
+$torqueGen.mergepoint("createOptions")##
+;
+
+$torqueGen.mergepoint("index")
+

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/tableComment.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/tableComment.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/tableComment.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/tableComment.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,17 @@
+## 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.
+## no Comments on tables in hsqldb

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/unique.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/unique.vm?rev=1212604&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/unique.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/unique.vm
Fri Dec  9 20:00:48 2011
@@ -0,0 +1,19 @@
+## 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.
+#if ($uniqueColumnNames != "")
+    UNIQUE($uniqueColumnNames),
+#end

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java?rev=1212604&r1=1212603&r2=1212604&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java Fri
Dec  9 20:00:48 2011
@@ -39,7 +39,7 @@ import org.apache.torque.adapter.DBAxion
 import org.apache.torque.adapter.DBCloudscape;
 import org.apache.torque.adapter.DBDerby;
 import org.apache.torque.adapter.DBFirebird;
-import org.apache.torque.adapter.DBHypersonicSQL;
+import org.apache.torque.adapter.DBHsqldb;
 import org.apache.torque.adapter.DBInformix;
 import org.apache.torque.adapter.DBInstantDB;
 import org.apache.torque.adapter.DBInterbase;
@@ -1002,7 +1002,7 @@ public class DataTest extends BaseRuntim
                      + ", should be 4");
         }
 
-        if (Torque.getDB(Torque.getDefaultDB()) instanceof DBHypersonicSQL)
+        if (Torque.getDB(Torque.getDefaultDB()) instanceof DBHsqldb)
         {
             log.error("testJoins(): Right joins are not supported by HSQLDB");
             // failing is "expected", so exit without error
@@ -1482,13 +1482,6 @@ public class DataTest extends BaseRuntim
         }
 
         // check ignore case in order by
-        cleanBookstore();
-        author = new Author();
-        author.setName("a");
-        author.save();
-        author = new Author();
-        author.setName("B");
-        author.save();
         if (db instanceof DBInterbase || db instanceof DBFirebird)
         {
             log.error("testIgnoreCase(): "
@@ -1498,30 +1491,42 @@ public class DataTest extends BaseRuntim
         }
         else
         {
-            criteria.clear();
-            criteria.setIgnoreCase(true);
-            criteria.addAscendingOrderByColumn(AuthorPeer.NAME);
-            result = AuthorPeer.doSelect(criteria);
-            assertTrue("Size of result is not 2, but " + result.size(),
-                    result.size() == 2);
-            author = result.get(0);
-            assertEquals("First", author.getName(), "a");
-
             cleanBookstore();
             author = new Author();
-            author.setName("A");
+            author.setName("AA");
+            author.save();
+            author = new Author();
+            author.setName("BB");
+            author.save();
+            author = new Author();
+            author.setName("ba");
             author.save();
             author = new Author();
-            author.setName("b");
+            author.setName("ab");
             author.save();
+
+            // check ignoreCase in Criteria
             criteria.clear();
             criteria.setIgnoreCase(true);
             criteria.addAscendingOrderByColumn(AuthorPeer.NAME);
             result = AuthorPeer.doSelect(criteria);
-            assertTrue("Size of result is not 2, but " + result.size(),
-                    result.size() == 2);
-            author = result.get(0);
-            assertEquals("First", author.getName(), "A");
+            assertTrue("Size of result is not 4, but " + result.size(),
+                    result.size() == 4);
+            assertEquals(result.get(0).getName(), "AA");
+            assertEquals(result.get(1).getName(), "ab");
+            assertEquals(result.get(2).getName(), "ba");
+            assertEquals(result.get(3).getName(), "BB");
+
+            // check ignoreCase in orderBy
+            criteria.clear();
+            criteria.addAscendingOrderByColumn(AuthorPeer.NAME, true);
+            result = AuthorPeer.doSelect(criteria);
+            assertTrue("Size of result is not 4, but " + result.size(),
+                    result.size() == 4);
+            assertEquals(result.get(0).getName(), "AA");
+            assertEquals(result.get(1).getName(), "ab");
+            assertEquals(result.get(2).getName(), "ba");
+            assertEquals(result.get(3).getName(), "BB");
         }
     }
 

Modified: db/torque/torque4/trunk/torque-test/src/test/profile/hsqldb/Torque.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/profile/hsqldb/Torque.properties?rev=1212604&r1=1212603&r2=1212604&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/profile/hsqldb/Torque.properties (original)
+++ db/torque/torque4/trunk/torque-test/src/test/profile/hsqldb/Torque.properties Fri Dec
 9 20:00:48 2011
@@ -22,12 +22,12 @@
 #
 
 torque.database.default = bookstore
-torque.database.bookstore.adapter = hypersonic
+torque.database.bookstore.adapter = hsqldb
 
 # Using commons-dbcp
 torque.dsfactory.bookstore.factory = org.apache.torque.dsfactory.SharedPoolDataSourceFactory
 torque.dsfactory.bookstore.connection.driver = org.hsqldb.jdbcDriver
-torque.dsfactory.bookstore.connection.url = jdbc:hsqldb:sqltest
+torque.dsfactory.bookstore.connection.url =jdbc:hsqldb:target/sqltest
 torque.dsfactory.bookstore.connection.user = sa
 torque.dsfactory.bookstore.connection.password = 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message