db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1405649 - in /db/torque/torque4/trunk/torque-templates/src: main/java/org/apache/torque/templates/platform/ main/java/org/apache/torque/templates/transformer/om/ main/java/org/apache/torque/templates/transformer/sql/ main/resources/org/apa...
Date Sun, 04 Nov 2012 22:07:23 GMT
Author: tfischer
Date: Sun Nov  4 22:07:22 2012
New Revision: 1405649

URL: http://svn.apache.org/viewvc?rev=1405649&view=rev
Log:
TORQUE-241: fix qualified name handling

Added:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/createDatabaseSchema.vm
Modified:
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/Platform.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformPostgresqlImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SqlAttributeName.java
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/conf/control.xml
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/templates/idtable.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/tableDatabaseNameConstantsInit.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/database.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/primaryKey.vm
    db/torque/torque4/trunk/torque-templates/src/test/schema/schema.xml

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/Platform.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/Platform.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/Platform.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/Platform.java
Sun Nov  4 22:07:22 2012
@@ -128,4 +128,13 @@ public interface Platform
      * @return the timestamp string, inclusive string escaping.
      */
     String getTimestampString(Date date);
+
+    /**
+     * Returns whether the database has schema support where a schema
+     * is not tied to a user (oracle) or database (mysql), but can be created
+     * separately.
+     *
+     * @return true if separate schema creation is possible, false if not.
+     */
+    boolean usesStandaloneSchema();
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformDefaultImpl.java
Sun Nov  4 22:07:22 2012
@@ -211,4 +211,16 @@ public class PlatformDefaultImpl impleme
         dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
         return dateFormat.format(date);
     }
+
+    /**
+     * Returns whether the database has schema support where a schema
+     * is not tied to a user (oracle) or database (mysql), but can be created
+     * separately.
+     *
+     * @return this implementation returns false.
+     */
+    public boolean usesStandaloneSchema()
+    {
+        return false;
+    }
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformHsqldbImpl.java
Sun Nov  4 22:07:22 2012
@@ -113,4 +113,15 @@ public class PlatformHsqldbImpl extends 
         return dateFormat.format(date);
     }
 
+    /**
+     * Returns whether the database has schema support where a schema
+     * is not tied to a user (oracle) or database (mysql), but can be created
+     * separately.
+     *
+     * @return this implementation returns true.
+     */
+    public boolean usesStandaloneSchema()
+    {
+        return true;
+    }
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMssqlImpl.java
Sun Nov  4 22:07:22 2012
@@ -117,4 +117,15 @@ public class PlatformMssqlImpl extends P
         return dateFormat.format(date);
     }
 
+    /**
+     * Returns whether the database has schema support where a schema
+     * is not tied to a user (oracle) or database (mysql), but can be created
+     * separately.
+     *
+     * @return this implementation returns true.
+     */
+    public boolean usesStandaloneSchema()
+    {
+        return true;
+    }
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformPostgresqlImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformPostgresqlImpl.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformPostgresqlImpl.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformPostgresqlImpl.java
Sun Nov  4 22:07:22 2012
@@ -128,4 +128,16 @@ public class PlatformPostgresqlImpl exte
     {
         return true;
     }
+
+    /**
+     * Returns whether the database has schema support where a schema
+     * is not tied to a user (oracle) or database (mysql), but can be created
+     * separately.
+     *
+     * @return this implementation returns true.
+     */
+    public boolean usesStandaloneSchema()
+    {
+        return true;
+    }
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/OMTableAndViewTransformer.java
Sun Nov  4 22:07:22 2012
@@ -51,6 +51,9 @@ import org.apache.torque.templates.trans
  */
 public class OMTableAndViewTransformer extends AttributeTransformer
 {
+    /** Constant for the dot. */
+    private static final String DOT = ".";
+
     /** The transformer for the column child elements. */
     private static OMColumnTransformer columnTransformer
             = new OMColumnTransformer();;
@@ -101,6 +104,7 @@ public class OMTableAndViewTransformer e
         throws SourceTransformerException
     {
         checkElementName(tableElement);
+        setUnqualifiedNameAttribute(tableElement);
         setJavaNameAttribute(tableElement,controllerState);
         setFieldNameAttribute(tableElement);
         setIdMethodAttribute(tableElement);
@@ -195,11 +199,11 @@ public class OMTableAndViewTransformer e
             Camelbacker javaNameCamelbacker = new Camelbacker();
             javaNameCamelbacker.setRemoveWithoutUppercase("");
             javaNameCamelbacker.setRemoveWithUppercase(
-                    javaNameCamelbacker.getRemoveWithUppercase() + ".");
+                    javaNameCamelbacker.getRemoveWithUppercase() + DOT);
             if (!controllerState.getBooleanOption(
                     TemplateOptionName.OM_RETAIN_SCHEMA_NAMES_IN_JAVA_NAME))
             {
-                javaNameCamelbacker.setIgnorePartBefore(".");
+                javaNameCamelbacker.setIgnorePartBefore(DOT);
             }
             javaName = javaNameCamelbacker.process(inputName.toString());
             tableElement.setAttribute(
@@ -208,6 +212,20 @@ public class OMTableAndViewTransformer e
         }
     }
 
+    protected void setUnqualifiedNameAttribute(SourceElement tableElement)
+    {
+        String name = (String)
+                tableElement.getAttribute(TorqueSchemaAttributeName.NAME);
+        String unqualifiedName = name;
+        if (StringUtils.contains(name, DOT))
+        {
+            unqualifiedName = name.substring(name.indexOf(DOT) + 1);
+        }
+        tableElement.setAttribute(
+                TableAttributeName.UNQUALIFIED_NAME,
+                unqualifiedName);
+    }
+
     protected void setIdMethodAttribute(SourceElement tableElement)
             throws SourceTransformerException
     {

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/om/TableAttributeName.java
Sun Nov  4 22:07:22 2012
@@ -28,6 +28,11 @@ import org.apache.torque.generator.sourc
 public enum TableAttributeName implements SourceAttributeName
 {
     /**
+     * The unqualified (without schema) table name.
+     */
+    UNQUALIFIED_NAME("unqualifiedName"),
+
+    /**
      * The name of the manager class.
      */
     MANAGER_CLASS_NAME("managerClassName"),

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLTransformer.java
Sun Nov  4 22:07:22 2012
@@ -68,6 +68,7 @@ public class SQLTransformer implements S
         {
             transformTable(tableElement, controllerState);
         }
+        addDatabaseSchemaElements(databaseElement, controllerState);
         return databaseElement;
     }
 
@@ -76,6 +77,17 @@ public class SQLTransformer implements S
             ControllerState controllerState)
         throws SourceTransformerException
     {
+        String tableName = (String) tableElement.getAttribute(
+                TorqueSchemaAttributeName.NAME);
+        String unqualifiedTableName = tableName;
+        if (StringUtils.contains(tableName, "."))
+        {
+            unqualifiedTableName = tableName.substring(tableName.indexOf(".") + 1);
+        }
+        tableElement.setAttribute(
+                SqlAttributeName.UNQUALIFIED_NAME,
+                unqualifiedTableName);
+
         Object idMethod = tableElement.getAttribute(
                 TorqueSchemaAttributeName.ID_METHOD.getName());
         if (idMethod == null)
@@ -94,13 +106,11 @@ public class SQLTransformer implements S
                     TorqueSchemaAttributeName.ID_METHOD.getName(),
                     defaultIdMethod);
         }
-        String tableName = (String) tableElement.getAttribute(
-                TorqueSchemaAttributeName.NAME);
         if (tableElement.getAttribute(
                 SqlAttributeName.PRIMARY_KEY_CONSTRAINT_NAME)
             == null)
         {
-            String primaryKeyConstraintName = tableName + "_PK";
+            String primaryKeyConstraintName = unqualifiedTableName + "_PK";
             tableElement.setAttribute(
                     SqlAttributeName.PRIMARY_KEY_CONSTRAINT_NAME,
                     primaryKeyConstraintName);
@@ -280,9 +290,7 @@ public class SQLTransformer implements S
                 ObjectUtils.toString(size, null),
                 ObjectUtils.toString(scale, null),
                 ObjectUtils.toString(defaultValue, null));
-        Platform platform = PlatformFactory.getPlatformFor(
-                controllerState.getStringOption(
-                        TemplateOptionName.DATABASE));
+        Platform platform = getPlatform(controllerState);
 
         List<String> resultList = new ArrayList<String>();
 
@@ -382,6 +390,14 @@ public class SQLTransformer implements S
         return StringUtils.join(resultList.iterator(), ' ');
     }
 
+    private Platform getPlatform(ControllerState controllerState)
+    {
+        Platform platform = PlatformFactory.getPlatformFor(
+                controllerState.getStringOption(
+                        TemplateOptionName.DATABASE));
+        return platform;
+    }
+
     /**
      * Sets additional attributes on foreign key elements.
      *
@@ -420,6 +436,39 @@ public class SQLTransformer implements S
                 foreignColumnsNames);
     }
 
+    private void addDatabaseSchemaElements(
+            SourceElement databaseElement,
+            ControllerState controllerState)
+    {
+        Platform platform = getPlatform(controllerState);
+        if (!platform.usesStandaloneSchema())
+        {
+            return;
+        }
+        List<String> databaseSchemaNames = new ArrayList<String>();
+        for (SourceElement tableElement
+                : databaseElement.getChildren(TorqueSchemaElementName.TABLE))
+        {
+            String name = (String)
+                    tableElement.getAttribute(TorqueSchemaAttributeName.NAME);
+            if (StringUtils.contains(name, '.'))
+            {
+                String databaseSchema = name.substring(0, name.indexOf('.'));
+                if (!databaseSchemaNames.contains(databaseSchema))
+                {
+                    databaseSchemaNames.add(databaseSchema);
+                }
+            }
+        }
+        for (String databaseSchemaName : databaseSchemaNames)
+        {
+            SourceElement databaseSchemaElement
+                = new SourceElement("databaseSchema");
+            databaseSchemaElement.setAttribute("name", databaseSchemaName);
+            databaseElement.getChildren().add(databaseSchemaElement);
+        }
+    }
+
     /**
      * Collects attribute values in a comma-separated string.
      * The elements on which the attribute values are read can be reached

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SqlAttributeName.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SqlAttributeName.java?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SqlAttributeName.java
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SqlAttributeName.java
Sun Nov  4 22:07:22 2012
@@ -27,6 +27,11 @@ import org.apache.torque.generator.sourc
 public enum SqlAttributeName implements SourceAttributeName
 {
     /**
+     * The unqualified (without schema) table name.
+     */
+    UNQUALIFIED_NAME("unqualifiedName"),
+
+    /**
      * The attribute contains all primary key columns
      * in a comma-separated String.
      */

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/conf/control.xml?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/conf/control.xml
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/conf/control.xml
Sun Nov  4 22:07:22 2012
@@ -40,6 +40,7 @@
       <suffix>-idtable-init.sql</suffix>
     </filenameOutlet>
     <source xsi:type="fileSource" elements="database">
+      <transformer class="org.apache.torque.templates.transformer.sql.SQLTransformer"/>
       <include>*schema.xml</include>
       <exclude>id-table-schema.xml</exclude>
      </source>

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/templates/idtable.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/templates/idtable.vm?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/templates/idtable.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/idtable/templates/idtable.vm
Sun Nov  4 22:07:22 2012
@@ -25,7 +25,7 @@
 #end
 #set ( $idValue = $initialId )
 #foreach ($tableElement in $tableElements)
-  #set ( $tableName = $tableElement.getAttribute("name") )
+  #set ( $tableName = $tableElement.getAttribute("unqualifiedName") )
 insert into ID_TABLE (id_table_id, table_name, next_id, quantity) VALUES ($idValue, '$tableName',
$initialIdValue, $initialIdStep);
   #set ( $idValue = $idValue + 1)
 #end

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/tableDatabaseNameConstantsInit.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/tableDatabaseNameConstantsInit.vm?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/tableDatabaseNameConstantsInit.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/om/templates/peer/base/tableDatabaseNameConstantsInit.vm
Sun Nov  4 22:07:22 2012
@@ -28,4 +28,4 @@
 ## as velocity variables.  
 ##
         DATABASE_NAME = "$torqueGen.getParent().getAttribute("name")";
-        TABLE_NAME = "$name";
+        TABLE_NAME = "$unqualifiedName";

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
Sun Nov  4 22:07:22 2012
@@ -36,6 +36,11 @@
           element="table" 
           outlet="torque.sql.ddl.dropTableSkipDecider"/>
     </mergepoint>
+    <mergepoint name="createSchema">
+      <action xsi:type="traverseAllAction" 
+          element="databaseSchema" 
+          outlet="torque.sql.ddl.createDatabaseSchema"/>
+    </mergepoint>
     <mergepoint name="tables">
       <action xsi:type="traverseAllAction" 
           element="table" 
@@ -113,6 +118,11 @@
       xsi:type="velocityOutlet"
       path="ddl/${option:database}/databaseStart.vm"/>
 
+  <outlet name="torque.sql.ddl.createDatabaseSchema"
+      xsi:type="velocityOutlet"
+      path="ddl/createDatabaseSchema.vm">
+  </outlet>
+
   <outlet name="torque.sql.ddl.table"
       xsi:type="velocityOutlet"
       path="ddl/${option:database}/table.vm">

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/createDatabaseSchema.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/createDatabaseSchema.vm?rev=1405649&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/createDatabaseSchema.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/createDatabaseSchema.vm
Sun Nov  4 22:07:22 2012
@@ -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.
+##
+
+CREATE SCHEMA ${name};

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/database.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/database.vm?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/database.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/database.vm
Sun Nov  4 22:07:22 2012
@@ -16,6 +16,7 @@
 ## under the License.
 $torqueGen.mergepoint("databaseStart")
 $torqueGen.mergepoint("drop")
+$torqueGen.mergepoint("createSchema")
 $torqueGen.mergepoint("tables")
 $torqueGen.mergepoint("foreignKeys")
 $torqueGen.mergepoint("views")

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/primaryKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/primaryKey.vm?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/primaryKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/primaryKey.vm
Sun Nov  4 22:07:22 2012
@@ -15,5 +15,5 @@
 ## specific language governing permissions and limitations
 ## under the License.
 #if ($primaryKeyColumnNames != "")
-    CONSTRAINT ${name}_PK PRIMARY KEY($primaryKeyColumnNames),
+    CONSTRAINT ${primaryKeyConstraintName} PRIMARY KEY($primaryKeyColumnNames),
 #end

Modified: db/torque/torque4/trunk/torque-templates/src/test/schema/schema.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/schema/schema.xml?rev=1405649&r1=1405648&r2=1405649&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/schema/schema.xml (original)
+++ db/torque/torque4/trunk/torque-templates/src/test/schema/schema.xml Sun Nov  4 22:07:22
2012
@@ -308,6 +308,15 @@
   </table>
   
   <!-- =================================================== -->
+  <!-- Q U A L I F I E D   T A B L E   N A M E             -->
+  <!-- =================================================== -->
+
+  <table name="torque.qualified_name" >
+    <column name="id" type="INTEGER"/>
+    <column name="payload" type="VARCHAR" size="100"/>
+  </table>
+
+  <!-- =================================================== -->
   <!-- V I E W                                             -->
   <!-- =================================================== -->
 



---------------------------------------------------------------------
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