svn commit: r1856067 [1/2] - in /db/torque/torque4/trunk/torque-templates/src: main/java/org/apache/torque/templates/platform/ main/java/org/apache/torque/templates/transformer/ main/java/org/apache/torque/templates/transformer/sql/ main/java/org/apach...

classic Classic list List threaded Threaded
1 message Options
gk
Reply | Threaded
Open this post in threaded view
|

svn commit: r1856067 [1/2] - in /db/torque/torque4/trunk/torque-templates/src: main/java/org/apache/torque/templates/platform/ main/java/org/apache/torque/templates/transformer/ main/java/org/apache/torque/templates/transformer/sql/ main/java/org/apach...

gk
Author: gk
Date: Fri Mar 22 15:32:47 2019
New Revision: 1856067

URL: http://svn.apache.org/viewvc?rev=1856067&view=rev
Log:
 -add parameterized test in junit test class TestProcessing
- preliminarily comment html/xdoc tests in junit test class TestProcessing, more info in TORQUE-358
- add timestamp test field in schema
- add scale handling in type mapping, transformer and platform

Added:
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql   (with props)
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql   (with props)
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql   (with props)
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql   (with props)
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql   (with props)
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-postgresql.sql   (with props)
Removed:
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema.sql
Modified:
    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/PlatformMysqlImpl.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/SchemaTypeHelper.java
    db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLModelTransformer.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/typemapping/SqlType.java
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/html/templates/html-table.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/xdoc/templates/xdoc-table.vm
    db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/GenerateOmClassesFromJavaTest.java
    db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/TestProcessing.java
    db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/jdbc2schema/Jdbc2SchemaTest.java
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-datamodel.xml
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema.html
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/jdbc2schema/expected-schema.xml
    db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/jdbc2schema/jdbc2schemaTest.sql
    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/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=1856067&r1=1856066&r2=1856067&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 Fri Mar 22 15:32:47 2019
@@ -101,6 +101,8 @@ public class PlatformHsqldbImpl extends
         dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
         return dateFormat.format(date);
     }
+    
+    
 
     /**
      * {@inheritDoc}
@@ -125,4 +127,15 @@ public class PlatformHsqldbImpl extends
     {
         return true;
     }
+    
+    @Override
+    public boolean hasSize(String sqlType) {
+        return "VARCHAR".equals(sqlType);
+    }
+    
+    @Override
+    public boolean hasScale(String sqlType) {
+        return "TIMESTAMP".equals(sqlType) || "DATE".equals(sqlType) || "TIME".equals(sqlType);
+    }
+    
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/platform/PlatformMysqlImpl.java Fri Mar 22 15:32:47 2019
@@ -20,6 +20,8 @@ package org.apache.torque.templates.plat
  */
 
 import java.text.SimpleDateFormat;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.TimeZone;
 
@@ -36,6 +38,9 @@ public class PlatformMysqlImpl extends P
 {
     /** The date format for formatting database dates. */
     private static final String DATE_FORMAT = "''yyyy-MM-dd''";
+    
+    /** The date format for formatting database dates. */
+    private static final String TIMESTAMP_FORMAT = "''yyyy-MM-dd HH:mm:ss.SSS''";
 
     /**
      * Default constructor.
@@ -59,7 +64,7 @@ public class PlatformMysqlImpl extends P
                 new SqlType("MEDIUMTEXT"));
         setSchemaTypeToSqlTypeMapping(
                 SchemaType.TIMESTAMP,
-                new SqlType("DATETIME(3)")); // support milliseconds
+                new SqlType("DATETIME")); // support milliseconds
         setSchemaTypeToSqlTypeMapping(
                 SchemaType.BINARY,
                 new SqlType("BLOB"));
@@ -96,6 +101,19 @@ public class PlatformMysqlImpl extends P
                 || "BLOB".equals(sqlType) || "MEDIUMBLOB".equals(sqlType)
                 || "LONGBLOB".equals(sqlType));
     }
+    
+    
+    /**
+     * precison in time formats is more like a scale, which is the number of digits to the right of the decimal point in a number.
+     *  
+     * @see Platform#hasScale(String)
+     */
+    @Override
+    public boolean hasScale(String sqlType)
+    {
+        return "TIMESTAMP".equals(sqlType) || "DATETIME".equals(sqlType) || "DATE".equals(sqlType) || "TIME".equals(sqlType);
+    }
+  
 
     @Override
     protected boolean escapeBackslashes()
@@ -113,4 +131,16 @@ public class PlatformMysqlImpl extends P
         dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
         return dateFormat.format(date);
     }
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getTimestampString(Date date)
+    {
+            return DateTimeFormatter.ofPattern(TIMESTAMP_FORMAT )
+                    //.withZone( ZoneId.of("GMT") )
+                    .format(date.toInstant()
+                            .atZone(ZoneId.of("GMT")));
+    }
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/SchemaTypeHelper.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/SchemaTypeHelper.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/SchemaTypeHelper.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/SchemaTypeHelper.java Fri Mar 22 15:32:47 2019
@@ -20,8 +20,8 @@ package org.apache.torque.templates.tran
  */
 
 import java.util.List;
+import java.util.Objects;
 
-import org.apache.commons.lang3.ObjectUtils;
 import org.apache.torque.generator.control.ControllerState;
 import org.apache.torque.generator.source.SourceElement;
 import org.apache.torque.generator.source.transform.SourceTransformerException;
@@ -277,16 +277,16 @@ public final class SchemaTypeHelper
                     + columnElement.getAttribute(TorqueSchemaAttributeName.NAME)
                     + " was not found in this schema");
         }
-        final String sqlType = ObjectUtils.toString(
+        final String sqlType = Objects.toString(
                 domainElement.getAttribute(TorqueSchemaAttributeName.TYPE),
                 null);
-        final String defaultValue = ObjectUtils.toString(
+        final String defaultValue = Objects.toString(
                 domainElement.getAttribute(TorqueSchemaAttributeName.DEFAULT),
                 null);
-        final String size = ObjectUtils.toString(
+        final String size = Objects.toString(
                 domainElement.getAttribute(TorqueSchemaAttributeName.SIZE),
                 null);
-        final String scale = ObjectUtils.toString(
+        final String scale = Objects.toString(
                 domainElement.getAttribute(TorqueSchemaAttributeName.SCALE),
                 null);
         return new SqlType(sqlType, size, scale, defaultValue);

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLModelTransformer.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLModelTransformer.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLModelTransformer.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/transformer/sql/SQLModelTransformer.java Fri Mar 22 15:32:47 2019
@@ -274,6 +274,11 @@ public class SQLModelTransformer impleme
             sqlTypeName += sqlType.printSize(
                     platform.getSizeSuffix(sqlTypeName));
         }
+        
+        if (platform.hasScale(sqlTypeName))
+        {
+            sqlTypeName += sqlType.printScale();
+        }
 
         resultList.add(sqlTypeName);
 

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=1856067&r1=1856066&r2=1856067&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 Fri Mar 22 15:32:47 2019
@@ -22,8 +22,8 @@ package org.apache.torque.templates.tran
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
-import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.torque.generator.control.ControllerState;
 import org.apache.torque.generator.source.SourceElement;
@@ -316,9 +316,9 @@ public class SQLTransformer implements S
                 schemaType,
                 domainType,
                 controllerState,
-                ObjectUtils.toString(size, null),
-                ObjectUtils.toString(scale, null),
-                ObjectUtils.toString(defaultValue, null));
+                Objects.toString(size, null),
+                Objects.toString(scale, null),
+                Objects.toString(defaultValue, null));
         Platform platform = getPlatform(controllerState);
 
         List<String> resultList = new ArrayList<>();
@@ -330,6 +330,11 @@ public class SQLTransformer implements S
             sqlTypeName += sqlType.printSize(
                     platform.getSizeSuffix(sqlTypeName));
         }
+        
+        if (platform.hasScale(sqlTypeName))
+        {
+            sqlTypeName += sqlType.printScale();
+        }
 
         resultList.add(sqlTypeName);
 

Modified: db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/typemapping/SqlType.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/typemapping/SqlType.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/typemapping/SqlType.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/java/org/apache/torque/templates/typemapping/SqlType.java Fri Mar 22 15:32:47 2019
@@ -202,9 +202,8 @@ public class SqlType
 
     /**
      * Return the size and scale in brackets for use in an SQL script.
-     *
-     * @param sizeSuffix size suffix value
-     * @return size and scale or an empty String if there are no values
+     *
+     * @return size and scale, size or an empty String if there are no values
      *         available.
      */
     public String printSize(final String sizeSuffix)
@@ -222,6 +221,24 @@ public class SqlType
             return "";
         }
     }
+    
+    /**
+     * Return the scale in brackets for use in an SQL script.
+     *
+     * @return scale or an empty String if there are no values
+     *         available.
+     */
+    public String printScale()
+    {
+        if (StringUtils.isNotBlank(scale))
+        {
+            return '(' + scale + ')';
+        }
+        else
+        {
+            return "";
+        }
+    }
 
     /**
      * Returns a new instance with the given sqlTypeName, size, scale
@@ -238,4 +255,5 @@ public class SqlType
     {
         return new SqlType(this, size, scale, defaultValue);
     }
+
 }

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/html/templates/html-table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/html/templates/html-table.vm?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/html/templates/html-table.vm (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/html/templates/html-table.vm Fri Mar 22 15:32:47 2019
@@ -34,6 +34,8 @@ $!description
   <tr class="detailrow">
   #set ( $columnName = $columnElement.getAttribute("name"))
   #set ( $columnSize = $columnElement.getAttribute("size"))
+   ## scale takes precedence of scale in inheritance
+  #set ( $columnScale = $columnElement.getAttribute("scale"))
   #set ( $columnDefault = $columnElement.getAttribute("default"))
   #set ( $columnDescription = $columnElement.getAttribute("description"))
   #set ( $columnPrimaryKey = $columnElement.getAttribute("primaryKey"))
@@ -50,7 +52,7 @@ $!description
   #end        
         </td>
     <td class="detailbackground detailborder detailtype">$columnFieldType</td>
-    <td class="detailbackground detailborder detailsize">#if ($columnSize && $columnSize.length() > 0) $columnSize #else &nbsp;#end</td>
+    <td class="detailbackground detailborder detailsize#if(($columnScale &&$columnScale.length() > 0)) detailscale#end">#if (($columnScale &&$columnScale.length() > 0)) $columnScale #elseif ($columnSize && $columnSize.length() > 0) $columnSize #else &nbsp;#end</td>
     <td class="detailbackground detailborder detaildefault">#if ($columnDefault) $columnDefault#else &nbsp;#end</td>
     <td class="detailbackground detailborder detailjavaname">$columnJavaName</td>
     <td class="detailbackground detailborder detailpk"><center> #if ($columnPrimaryKey=="true")X#else &nbsp;#end </center></td>

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/xdoc/templates/xdoc-table.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/xdoc/templates/xdoc-table.vm?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/xdoc/templates/xdoc-table.vm (original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/doc/xdoc/templates/xdoc-table.vm Fri Mar 22 15:32:47 2019
@@ -34,7 +34,9 @@
 #foreach ($columnElement in $torqueGen.getChildren("column"))
     <tr class="detailrow">
   #set ( $columnName = $columnElement.getAttribute("name"))
+  ## scale takes precedence of scale in inheritance
   #set ( $columnSize = $columnElement.getAttribute("size"))
+  #set ( $columnScale = $columnElement.getAttribute("scale"))
   #set ( $columnDefault = $columnElement.getAttribute("default"))
   #set ( $columnDescription = $columnElement.getAttribute("description"))
   #set ( $columnPrimaryKey = $columnElement.getAttribute("primaryKey"))
@@ -51,7 +53,7 @@
   #end        
       </td>
       <td class="detailbackground detailborder detailtype">$columnFieldType</td>
-      <td class="detailbackground detailborder detailsize">#if ($columnSize && $columnSize.length() > 0) $columnSize #else &#160;#end</td>
+      <td class="detailbackground detailborder detailsize#if($columnScale &&$columnScale.length() > 0) detailscale#end">#if ($columnScale &&$columnScale.length() > 0) $columnScale #elseif ($columnSize && $columnSize.length() > 0) $columnSize #else &#160;#end</td>
       <td class="detailbackground detailborder detaildefault">#if ($columnDefault) $columnDefault#else &#160;#end</td>
       <td class="detailbackground detailborder detailjavaname">$columnJavaName</td>
       <td class="detailbackground detailborder detailpk"><center> #if ($columnPrimaryKey=="true")X#else &#160;#end </center></td>

Modified: db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/GenerateOmClassesFromJavaTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/GenerateOmClassesFromJavaTest.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/GenerateOmClassesFromJavaTest.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/GenerateOmClassesFromJavaTest.java Fri Mar 22 15:32:47 2019
@@ -42,7 +42,7 @@ import org.junit.jupiter.api.Test;
  *
  * This does not really test the templates,
  * however in the reference documentation it is mentioned how to use
- * the genrator/tempaltes from java, and this test makes sure it works
+ * the generator/templates from java, and this test makes sure it works
  * as documented.
  *
  * @version $Id$

Modified: db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/TestProcessing.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/TestProcessing.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/TestProcessing.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/TestProcessing.java Fri Mar 22 15:32:47 2019
@@ -44,7 +44,10 @@ import org.apache.torque.generator.file.
 import org.apache.torque.generator.source.SourceProvider;
 import org.apache.torque.generator.source.stream.FileSourceProvider;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
 
 
 public class TestProcessing
@@ -214,7 +217,15 @@ public class TestProcessing
         assertFalse(generationFolder2.exists());
     }
 
-    @Test
+    /**
+     * Ignore until
+     *
+     * https://issues.apache.org/jira/projects/TORQUE/issues/TORQUE-358?filter=allopenissues
+     * is resolved
+     *
+     * @throws Exception
+     */
+    @Disabled
     public void testHtmlDocTemplates() throws Exception
     {
         File generationFolder = new File("target/generated-docs");
@@ -264,7 +275,15 @@ public class TestProcessing
         assertFalse(generationFolder2.exists());
     }
 
-    @Test
+    /**
+     * Ignore until
+     *
+     * https://issues.apache.org/jira/projects/TORQUE/issues/TORQUE-358?filter=allopenissues
+     * is resolved
+     *
+     * @throws Exception
+     */
+    @Disabled
     public void testXdocTemplates() throws Exception
     {
         File generationFolder = new File("target/generated-xdocs");
@@ -303,8 +322,9 @@ public class TestProcessing
         assertFalse(generationFolder2.exists());
     }
 
-    @Test
-    public void testSqlDdlTemplates() throws Exception
+    @ParameterizedTest
+    @ValueSource(strings = { "mysql", "oracle", "mssql", "postgresql", "hsqldb", "derby" } )
+    public void testSqlDdlTemplates(String dbType) throws Exception
     {
         File generationFolder = new File("target/generated-sql");
         File generationFolder2 = new File("target/generated-sql-2");
@@ -314,7 +334,7 @@ public class TestProcessing
         final Controller controller = new Controller();
         final List<UnitDescriptor> unitDescriptors = new ArrayList<>();
         final Map<String, String> overrideOptions = new HashMap<>();
-        overrideOptions.put("torque.database", "mysql");
+        overrideOptions.put("torque.database", dbType);
 
         final CustomProjectPaths projectPaths
             = new CustomProjectPaths(
@@ -337,7 +357,7 @@ public class TestProcessing
         // generate
         controller.run(unitDescriptors);
 
-        assertOutput("expected-schema.sql", "target/generated-sql/schema.sql");
+        assertOutput("expected-schema-"+dbType+".sql", "target/generated-sql/schema.sql");
         assertFalse(generationFolder2.exists());
     }
 

Modified: db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/jdbc2schema/Jdbc2SchemaTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/jdbc2schema/Jdbc2SchemaTest.java?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/jdbc2schema/Jdbc2SchemaTest.java (original)
+++ db/torque/torque4/trunk/torque-templates/src/test/java/org/apache/torque/templates/jdbc2schema/Jdbc2SchemaTest.java Fri Mar 22 15:32:47 2019
@@ -29,6 +29,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.SQLException;
@@ -40,9 +41,9 @@ import java.util.Map;
 import java.util.StringTokenizer;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.BasicConfigurator;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.torque.generator.GeneratorException;
 import org.apache.torque.generator.configuration.UnitDescriptor;
 import org.apache.torque.generator.configuration.option.MapOptionsConfiguration;
@@ -60,8 +61,8 @@ import org.xmlunit.diff.ElementSelectors
 
 public class Jdbc2SchemaTest /* implements TestExecutionExceptionHandler */
 {
-    private static Log log
-    = LogFactory.getLog(Jdbc2SchemaTest.class);
+    private static Logger log
+    = LogManager.getLogger(Jdbc2SchemaTest.class);
 
     private static String SQL_FILENAME = "jdbc2schemaTest.sql";
 
@@ -155,10 +156,10 @@ public class Jdbc2SchemaTest /* implemen
 
             File generatedFile = new File("target/generated-schema/schema.xml");
             assertTrue(generatedFile.exists());
-            String result = FileUtils.readFileToString(generatedFile);
+            String result = FileUtils.readFileToString(generatedFile, StandardCharsets.UTF_8);
             File referenceFile = new File(
                     "src/test/resources/org/apache/torque/templates/jdbc2schema/expected-schema.xml");
-            String reference = FileUtils.readFileToString(referenceFile);
+            String reference = FileUtils.readFileToString(referenceFile, StandardCharsets.UTF_8);
             
             Diff myDiffSimilar = DiffBuilder.compare(reference).ignoreComments().withTest(result)
                     .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byName))

Modified: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-datamodel.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-datamodel.xml?rev=1856067&r1=1856066&r2=1856067&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-datamodel.xml (original)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-datamodel.xml Fri Mar 22 15:32:47 2019
@@ -142,6 +142,19 @@
     </tr>
     <tr class="detailrow">
   
+      <td class="detailbackground detailborder detailname notnull" id="acreated_at">created_at
+      </td>
+      <td class="detailbackground detailborder detailtype">java.util.Date</td>
+      <td class="detailbackground detailborder detailsize detailscale"> 6 </td>
+      <td class="detailbackground detailborder detaildefault"> a_name</td>
+      <td class="detailbackground detailborder detailjavaname">CreatedAt</td>
+      <td class="detailbackground detailborder detailpk"><center>  &#160; </center></td>
+      <td class="detailbackground detailborder detailfk"><center>  &#160; </center></td>
+      <td class="detailbackground detailborder detailnotnull"><center> X </center></td>
+      <td class="detailbackground detailborder detaildescription"> &#160;</td>
+    </tr>
+    <tr class="detailrow">
+  
       <td class="detailbackground detailborder detailname" id="aenum">enum
       </td>
       <td class="detailbackground detailborder detailtype">EnumEnum</td>

Added: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql?rev=1856067&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql (added)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql Fri Mar 22 15:32:47 2019
@@ -0,0 +1,303 @@
+## 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.
+##
+-- -----------------------------------------------------------------------
+-- derby SQL script for schema bookstore
+-- -----------------------------------------------------------------------
+
+
+DROP VIEW a_b;
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_1;
+
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_1;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_3;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_1;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_2;
+
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    DROP CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1;
+
+
+ALTER TABLE ext_schema
+    DROP CONSTRAINT ext_schema_FK_1;
+
+
+ALTER TABLE extext_schema
+    DROP CONSTRAINT extext_schema_FK_1;
+
+
+drop table a;
+drop table b;
+drop table r_ab;
+drop table c;
+drop table d;
+drop table nopk;
+drop table MULTIPK_SELF_REFTABLE;
+drop table ifc_table;
+drop table ifc_table2;
+drop table INHERITANCE_TEST;
+drop table ext_schema;
+drop table extext_schema;
+drop table torque.qualified_name;
+
+-- -----------------------------------------------------------------------
+-- a
+-- -----------------------------------------------------------------------
+CREATE TABLE a
+(
+    a_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    name VARCHAR(50) default 'a_name' NOT NULL,
+    contactdata VARCHAR(500) NOT NULL,
+    created_at TIMESTAMP default CURRENT_TIMESTAMP NOT NULL,
+    updated_at TIMESTAMP NOT NULL,
+    enum VARCHAR(50) default 'x',
+    PRIMARY KEY(a_id)
+);
+
+CREATE INDEX NAME_IDX ON a (name);
+
+-- -----------------------------------------------------------------------
+-- b
+-- -----------------------------------------------------------------------
+CREATE TABLE b
+(
+    b_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(b_id),
+    CONSTRAINT NAME_UNQ UNIQUE(name)
+);
+
+
+-- -----------------------------------------------------------------------
+-- r_ab
+-- -----------------------------------------------------------------------
+CREATE TABLE r_ab
+(
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(a_id, b_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- c
+-- -----------------------------------------------------------------------
+CREATE TABLE c
+(
+    c_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(c_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- d
+-- -----------------------------------------------------------------------
+CREATE TABLE d
+(
+    d_id INTEGER NOT NULL,
+    name VARCHAR(255) NOT NULL,
+    b_id INTEGER NOT NULL,
+    a_id INTEGER NOT NULL,
+    PRIMARY KEY(d_id, b_id, a_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- nopk
+-- -----------------------------------------------------------------------
+CREATE TABLE nopk
+(
+    intcol INTEGER,
+    name VARCHAR(50)
+);
+
+
+-- -----------------------------------------------------------------------
+-- MULTIPK_SELF_REFTABLE
+-- -----------------------------------------------------------------------
+CREATE TABLE MULTIPK_SELF_REFTABLE
+(
+    COL1 DECIMAL NOT NULL,
+    COL2 DECIMAL NOT NULL,
+    PARENT_COL1 DECIMAL NOT NULL,
+    PARENT_COL2 DECIMAL NOT NULL,
+    PRIMARY KEY(COL1, COL2)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table2
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table2
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- INHERITANCE_TEST
+-- -----------------------------------------------------------------------
+CREATE TABLE INHERITANCE_TEST
+(
+    INHERITANCE_TEST INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    CLASS_NAME CHAR(1),
+    PAYLOAD_PARENT VARCHAR(100) NOT NULL,
+    PAYLOAD_B VARCHAR(100),
+    PAYLOAD_C VARCHAR(100),
+    PAYLOAD_D VARCHAR(100),
+    PRIMARY KEY(INHERITANCE_TEST)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE ext_schema
+(
+    ext_schema_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    ext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(ext_schema_id)
+);
+
+CREATE INDEX index_ext_id ON ext_schema (ext_id);
+
+-- -----------------------------------------------------------------------
+-- extext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE extext_schema
+(
+    extext_schema_id INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+    extext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(extext_schema_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- torque.qualified_name
+-- -----------------------------------------------------------------------
+CREATE TABLE torque.qualified_name
+(
+    id INTEGER,
+    payload VARCHAR(100)
+);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_2
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_1
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_2
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_3
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_2
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1
+    FOREIGN KEY (PARENT_COL1, PARENT_COL2)
+    REFERENCES MULTIPK_SELF_REFTABLE (COL1, COL2);
+
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_FK_1
+    FOREIGN KEY (ext_id)
+    REFERENCES ext (ext_id);
+
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_FK_1
+    FOREIGN KEY (extext_id)
+    REFERENCES extext (extext_id);
+
+ALTER TABLE a
+    ADD CONSTRAINT enum_CHECK
+    CHECK
+    (enum in ('x', 'y', 'z'));
+
+CREATE VIEW a_b AS
+    SELECT
+    a.a_id AS a_id,
+    a.name AS a_name,
+    b.b_id AS b_id,
+    b.name AS b_name,
+    a.enum AS enum
+    from a join r_ab on a.a_id=r_ab.a_id join b on r_ab.b_id=b.b_id;
+
+

Propchange: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-derby.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql?rev=1856067&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql (added)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql Fri Mar 22 15:32:47 2019
@@ -0,0 +1,307 @@
+## 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.
+##
+-- -----------------------------------------------------------------------
+-- hsqldb SQL script for schema bookstore
+-- -----------------------------------------------------------------------
+
+
+DROP VIEW a_b IF EXISTS;
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_1;
+
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_1;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_3;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_1;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_2;
+
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    DROP CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1;
+
+
+ALTER TABLE ext_schema
+    DROP CONSTRAINT ext_schema_FK_1;
+
+
+ALTER TABLE extext_schema
+    DROP CONSTRAINT extext_schema_FK_1;
+
+
+drop table a;
+drop table b;
+drop table r_ab;
+drop table c;
+drop table d;
+drop table nopk;
+drop table MULTIPK_SELF_REFTABLE;
+drop table ifc_table;
+drop table ifc_table2;
+drop table INHERITANCE_TEST;
+drop table ext_schema;
+drop table extext_schema;
+drop table torque.qualified_name;
+
+DROP SCHEMA torque;
+
+CREATE SCHEMA torque;
+
+-- -----------------------------------------------------------------------
+-- a
+-- -----------------------------------------------------------------------
+CREATE TABLE a
+(
+    a_id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    name VARCHAR(50) default 'a_name' NOT NULL,
+    contactdata VARCHAR(500) NOT NULL,
+    created_at TIMESTAMP(6) default CURRENT_TIMESTAMP NOT NULL,
+    updated_at TIMESTAMP(6) NOT NULL,
+    enum VARCHAR(50) default 'x',
+    PRIMARY KEY(a_id)
+);
+
+CREATE INDEX NAME_IDX ON a (name);
+
+-- -----------------------------------------------------------------------
+-- b
+-- -----------------------------------------------------------------------
+CREATE TABLE b
+(
+    b_id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(b_id),
+    CONSTRAINT NAME_UNQ UNIQUE(name)
+);
+
+
+-- -----------------------------------------------------------------------
+-- r_ab
+-- -----------------------------------------------------------------------
+CREATE TABLE r_ab
+(
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(a_id, b_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- c
+-- -----------------------------------------------------------------------
+CREATE TABLE c
+(
+    c_id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(c_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- d
+-- -----------------------------------------------------------------------
+CREATE TABLE d
+(
+    d_id INTEGER NOT NULL,
+    name VARCHAR(255) NOT NULL,
+    b_id INTEGER NOT NULL,
+    a_id INTEGER NOT NULL,
+    PRIMARY KEY(d_id, b_id, a_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- nopk
+-- -----------------------------------------------------------------------
+CREATE TABLE nopk
+(
+    intcol INTEGER,
+    name VARCHAR(50)
+);
+
+
+-- -----------------------------------------------------------------------
+-- MULTIPK_SELF_REFTABLE
+-- -----------------------------------------------------------------------
+CREATE TABLE MULTIPK_SELF_REFTABLE
+(
+    COL1 DECIMAL NOT NULL,
+    COL2 DECIMAL NOT NULL,
+    PARENT_COL1 DECIMAL NOT NULL,
+    PARENT_COL2 DECIMAL NOT NULL,
+    PRIMARY KEY(COL1, COL2)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table2
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table2
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- INHERITANCE_TEST
+-- -----------------------------------------------------------------------
+CREATE TABLE INHERITANCE_TEST
+(
+    INHERITANCE_TEST INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    CLASS_NAME VARCHAR(1),
+    PAYLOAD_PARENT VARCHAR(100) NOT NULL,
+    PAYLOAD_B VARCHAR(100),
+    PAYLOAD_C VARCHAR(100),
+    PAYLOAD_D VARCHAR(100),
+    PRIMARY KEY(INHERITANCE_TEST)
+);
+
+
+-- -----------------------------------------------------------------------
+-- ext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE ext_schema
+(
+    ext_schema_id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    ext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(ext_schema_id)
+);
+
+CREATE INDEX index_ext_id ON ext_schema (ext_id);
+
+-- -----------------------------------------------------------------------
+-- extext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE extext_schema
+(
+    extext_schema_id INTEGER GENERATED BY DEFAULT AS IDENTITY (START WITH 1) NOT NULL,
+    extext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(extext_schema_id)
+);
+
+
+-- -----------------------------------------------------------------------
+-- torque.qualified_name
+-- -----------------------------------------------------------------------
+CREATE TABLE torque.qualified_name
+(
+    id INTEGER,
+    payload VARCHAR(100)
+);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_2
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_1
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_2
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_3
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_2
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1
+    FOREIGN KEY (PARENT_COL1, PARENT_COL2)
+    REFERENCES MULTIPK_SELF_REFTABLE (COL1, COL2);
+
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_FK_1
+    FOREIGN KEY (ext_id)
+    REFERENCES ext (ext_id);
+
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_FK_1
+    FOREIGN KEY (extext_id)
+    REFERENCES extext (extext_id);
+
+ALTER TABLE a
+    ADD CONSTRAINT enum_CHECK
+    CHECK
+    (enum in ('x', 'y', 'z'));
+
+CREATE VIEW a_b AS
+    SELECT
+    a.a_id AS a_id,
+    a.name AS a_name,
+    b.b_id AS b_id,
+    b.name AS b_name,
+    a.enum AS enum
+    from a join r_ab on a.a_id=r_ab.a_id join b on r_ab.b_id=b.b_id;
+
+

Propchange: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-hsqldb.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql?rev=1856067&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql (added)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql Fri Mar 22 15:32:47 2019
@@ -0,0 +1,675 @@
+## 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.
+##
+-- -----------------------------------------------------------------------
+-- mssql SQL script for schema bookstore
+-- -----------------------------------------------------------------------
+
+
+DROP VIEW a_b;
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_1;
+
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_1;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_3;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_1;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_2;
+
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    DROP CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1;
+
+
+ALTER TABLE ext_schema
+    DROP CONSTRAINT ext_schema_FK_1;
+
+
+ALTER TABLE extext_schema
+    DROP CONSTRAINT extext_schema_FK_1;
+
+
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'a')
+BEGIN
+     DECLARE @reftable_3 nvarchar(60), @constraintname_3 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'a'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_3, @constraintname_3
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_3+' drop constraint '+@constraintname_3)
+       FETCH NEXT from refcursor into @reftable_3, @constraintname_3
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE a
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'b')
+BEGIN
+     DECLARE @reftable_4 nvarchar(60), @constraintname_4 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'b'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_4, @constraintname_4
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_4+' drop constraint '+@constraintname_4)
+       FETCH NEXT from refcursor into @reftable_4, @constraintname_4
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE b
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'r_ab')
+BEGIN
+     DECLARE @reftable_5 nvarchar(60), @constraintname_5 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'r_ab'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_5, @constraintname_5
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_5+' drop constraint '+@constraintname_5)
+       FETCH NEXT from refcursor into @reftable_5, @constraintname_5
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE r_ab
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'c')
+BEGIN
+     DECLARE @reftable_6 nvarchar(60), @constraintname_6 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'c'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_6, @constraintname_6
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_6+' drop constraint '+@constraintname_6)
+       FETCH NEXT from refcursor into @reftable_6, @constraintname_6
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE c
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'd')
+BEGIN
+     DECLARE @reftable_7 nvarchar(60), @constraintname_7 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'd'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_7, @constraintname_7
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_7+' drop constraint '+@constraintname_7)
+       FETCH NEXT from refcursor into @reftable_7, @constraintname_7
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE d
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'nopk')
+BEGIN
+     DECLARE @reftable_8 nvarchar(60), @constraintname_8 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'nopk'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_8, @constraintname_8
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_8+' drop constraint '+@constraintname_8)
+       FETCH NEXT from refcursor into @reftable_8, @constraintname_8
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE nopk
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'MULTIPK_SELF_REFTABLE')
+BEGIN
+     DECLARE @reftable_9 nvarchar(60), @constraintname_9 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'MULTIPK_SELF_REFTABLE'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_9, @constraintname_9
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_9+' drop constraint '+@constraintname_9)
+       FETCH NEXT from refcursor into @reftable_9, @constraintname_9
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE MULTIPK_SELF_REFTABLE
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'ifc_table')
+BEGIN
+     DECLARE @reftable_10 nvarchar(60), @constraintname_10 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'ifc_table'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_10, @constraintname_10
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_10+' drop constraint '+@constraintname_10)
+       FETCH NEXT from refcursor into @reftable_10, @constraintname_10
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE ifc_table
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'ifc_table2')
+BEGIN
+     DECLARE @reftable_11 nvarchar(60), @constraintname_11 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'ifc_table2'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_11, @constraintname_11
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_11+' drop constraint '+@constraintname_11)
+       FETCH NEXT from refcursor into @reftable_11, @constraintname_11
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE ifc_table2
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'INHERITANCE_TEST')
+BEGIN
+     DECLARE @reftable_12 nvarchar(60), @constraintname_12 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'INHERITANCE_TEST'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_12, @constraintname_12
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_12+' drop constraint '+@constraintname_12)
+       FETCH NEXT from refcursor into @reftable_12, @constraintname_12
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE INHERITANCE_TEST
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'ext_schema')
+BEGIN
+     DECLARE @reftable_13 nvarchar(60), @constraintname_13 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'ext_schema'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_13, @constraintname_13
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_13+' drop constraint '+@constraintname_13)
+       FETCH NEXT from refcursor into @reftable_13, @constraintname_13
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE ext_schema
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'extext_schema')
+BEGIN
+     DECLARE @reftable_14 nvarchar(60), @constraintname_14 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'extext_schema'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_14, @constraintname_14
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_14+' drop constraint '+@constraintname_14)
+       FETCH NEXT from refcursor into @reftable_14, @constraintname_14
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE extext_schema
+END
+;
+IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'qualified_name')
+BEGIN
+     DECLARE @reftable_15 nvarchar(60), @constraintname_15 nvarchar(60)
+     DECLARE refcursor CURSOR FOR
+     select reftables.name tablename, cons.name constraintname
+      from sysobjects tables,
+           sysobjects reftables,
+           sysobjects cons,
+           sysreferences ref
+       where tables.id = ref.rkeyid
+         and cons.id = ref.constid
+         and reftables.id = ref.fkeyid
+         and tables.name = 'torque.qualified_name'
+     OPEN refcursor
+     FETCH NEXT from refcursor into @reftable_15, @constraintname_15
+     while @@FETCH_STATUS = 0
+     BEGIN
+       exec ('alter table '+@reftable_15+' drop constraint '+@constraintname_15)
+       FETCH NEXT from refcursor into @reftable_15, @constraintname_15
+     END
+     CLOSE refcursor
+     DEALLOCATE refcursor
+     DROP TABLE torque.qualified_name
+END
+;
+
+DROP SCHEMA torque;
+
+CREATE SCHEMA torque;
+
+/* ----------------------------------------------------------------------- */
+/* a                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE a
+(
+    a_id INT NOT NULL IDENTITY,
+    name VARCHAR(50) default 'a_name' NOT NULL,
+    contactdata VARCHAR(500) NOT NULL,
+    created_at DATETIME(6) default CURRENT_TIMESTAMP NOT NULL,
+    updated_at DATETIME(6) NOT NULL,
+    enum VARCHAR(50) default 'x' NULL,
+    CONSTRAINT a_PK PRIMARY KEY(a_id)
+)
+
+;
+CREATE INDEX NAME_IDX ON a (name);
+
+
+/* ----------------------------------------------------------------------- */
+/* b                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE b
+(
+    b_id INT NOT NULL IDENTITY,
+    name VARCHAR(50) NOT NULL,
+    CONSTRAINT b_PK PRIMARY KEY(b_id),
+    CONSTRAINT NAME_UNQ UNIQUE (name)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* r_ab                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE r_ab
+(
+    a_id INT NOT NULL,
+    b_id INT NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    CONSTRAINT r_ab_PK PRIMARY KEY(a_id, b_id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* c                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE c
+(
+    c_id INT NOT NULL IDENTITY,
+    a_id INT NOT NULL,
+    b_id INT NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    CONSTRAINT c_PK PRIMARY KEY(c_id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* d                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE d
+(
+    d_id INT NOT NULL,
+    name VARCHAR(255) NOT NULL,
+    b_id INT NOT NULL,
+    a_id INT NOT NULL,
+    CONSTRAINT d_PK PRIMARY KEY(d_id, b_id, a_id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* nopk                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE nopk
+(
+    intcol INT NULL,
+    name VARCHAR(50) NULL
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* MULTIPK_SELF_REFTABLE                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE MULTIPK_SELF_REFTABLE
+(
+    COL1 DECIMAL NOT NULL,
+    COL2 DECIMAL NOT NULL,
+    PARENT_COL1 DECIMAL NOT NULL,
+    PARENT_COL2 DECIMAL NOT NULL,
+    CONSTRAINT MULTIPK_SELF_REFTABLE_PK PRIMARY KEY(COL1, COL2)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* ifc_table                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE ifc_table
+(
+    id INT NOT NULL,
+    name VARCHAR(50) NULL,
+    CONSTRAINT ifc_table_PK PRIMARY KEY(id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* ifc_table2                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE ifc_table2
+(
+    id INT NOT NULL,
+    name VARCHAR(50) NULL,
+    CONSTRAINT ifc_table2_PK PRIMARY KEY(id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* INHERITANCE_TEST                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE INHERITANCE_TEST
+(
+    INHERITANCE_TEST INT NOT NULL IDENTITY,
+    CLASS_NAME CHAR(1) NULL,
+    PAYLOAD_PARENT VARCHAR(100) NOT NULL,
+    PAYLOAD_B VARCHAR(100) NULL,
+    PAYLOAD_C VARCHAR(100) NULL,
+    PAYLOAD_D VARCHAR(100) NULL,
+    CONSTRAINT INHERITANCE_TEST_PK PRIMARY KEY(INHERITANCE_TEST)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* ext_schema                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE ext_schema
+(
+    ext_schema_id INT NOT NULL IDENTITY,
+    ext_id INT NULL,
+    test INT NOT NULL,
+    CONSTRAINT ext_schema_PK PRIMARY KEY(ext_schema_id)
+)
+
+;
+CREATE INDEX index_ext_id ON ext_schema (ext_id);
+
+
+/* ----------------------------------------------------------------------- */
+/* extext_schema                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE extext_schema
+(
+    extext_schema_id INT NOT NULL IDENTITY,
+    extext_id INT NULL,
+    test INT NOT NULL,
+    CONSTRAINT extext_schema_PK PRIMARY KEY(extext_schema_id)
+)
+
+;
+
+
+/* ----------------------------------------------------------------------- */
+/* torque.qualified_name                                                */
+/* ----------------------------------------------------------------------- */
+CREATE TABLE torque.qualified_name
+(
+    id INT NULL,
+    payload VARCHAR(100) NULL
+)
+
+;
+
+BEGIN
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id)
+
+END
+;
+BEGIN
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_2
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id)
+
+END
+;
+BEGIN
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_1
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id)
+
+END
+;
+BEGIN
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_2
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id)
+
+END
+;
+BEGIN
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_3
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id)
+
+END
+;
+BEGIN
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id)
+
+END
+;
+BEGIN
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_2
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id)
+
+END
+;
+BEGIN
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1
+    FOREIGN KEY (PARENT_COL1, PARENT_COL2)
+    REFERENCES MULTIPK_SELF_REFTABLE (COL1, COL2)
+
+END
+;
+BEGIN
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_FK_1
+    FOREIGN KEY (ext_id)
+    REFERENCES ext (ext_id)
+
+END
+;
+BEGIN
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_FK_1
+    FOREIGN KEY (extext_id)
+    REFERENCES extext (extext_id)
+
+END
+;
+ALTER TABLE a
+    ADD CONSTRAINT enum_CHECK
+    CHECK
+    (enum in ('x', 'y', 'z'));
+
+CREATE VIEW a_b AS
+    SELECT
+    a.a_id AS a_id,
+    a.name AS a_name,
+    b.b_id AS b_id,
+    b.name AS b_name,
+    a.enum AS enum
+    from a join r_ab on a.a_id=r_ab.a_id join b on r_ab.b_id=b.b_id;
+
+

Propchange: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mssql.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql?rev=1856067&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql (added)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql Fri Mar 22 15:32:47 2019
@@ -0,0 +1,301 @@
+## 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.
+##
+-- -----------------------------------------------------------------------
+-- mysql SQL script for schema bookstore
+-- -----------------------------------------------------------------------
+
+
+ALTER TABLE r_ab
+    DROP FOREIGN KEY r_ab_FK_1;
+
+
+ALTER TABLE r_ab
+    DROP FOREIGN KEY r_ab_FK_2;
+
+
+ALTER TABLE c
+    DROP FOREIGN KEY c_FK_1;
+
+
+ALTER TABLE c
+    DROP FOREIGN KEY c_FK_2;
+
+
+ALTER TABLE c
+    DROP FOREIGN KEY c_FK_3;
+
+
+ALTER TABLE d
+    DROP FOREIGN KEY d_FK_1;
+
+
+ALTER TABLE d
+    DROP FOREIGN KEY d_FK_2;
+
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    DROP FOREIGN KEY MULTIPK_SELF_REFTABLE_FK_1;
+
+
+ALTER TABLE ext_schema
+    DROP FOREIGN KEY ext_schema_FK_1;
+
+
+ALTER TABLE extext_schema
+    DROP FOREIGN KEY extext_schema_FK_1;
+
+
+drop table if exists a;
+drop table if exists b;
+drop table if exists r_ab;
+drop table if exists c;
+drop table if exists d;
+drop table if exists nopk;
+drop table if exists MULTIPK_SELF_REFTABLE;
+drop table if exists ifc_table;
+drop table if exists ifc_table2;
+drop table if exists INHERITANCE_TEST;
+drop table if exists ext_schema;
+drop table if exists extext_schema;
+drop table if exists torque.qualified_name;
+
+# -----------------------------------------------------------------------
+# a
+# -----------------------------------------------------------------------
+CREATE TABLE a
+(
+    a_id INTEGER NOT NULL AUTO_INCREMENT,
+    name VARCHAR(50) default 'a_name' NOT NULL,
+    contactdata VARCHAR(500) NOT NULL,
+    created_at DATETIME(6) default CURRENT_TIMESTAMP NOT NULL,
+    updated_at DATETIME(6) NOT NULL,
+    enum VARCHAR(50) default 'x',
+    PRIMARY KEY(a_id),
+    INDEX NAME_IDX(name)
+);
+
+
+# -----------------------------------------------------------------------
+# b
+# -----------------------------------------------------------------------
+CREATE TABLE b
+(
+    b_id INTEGER NOT NULL AUTO_INCREMENT,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(b_id),
+    UNIQUE NAME_UNQ (name)
+);
+
+
+# -----------------------------------------------------------------------
+# r_ab
+# -----------------------------------------------------------------------
+CREATE TABLE r_ab
+(
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(a_id, b_id)
+);
+
+
+# -----------------------------------------------------------------------
+# c
+# -----------------------------------------------------------------------
+CREATE TABLE c
+(
+    c_id INTEGER NOT NULL AUTO_INCREMENT,
+    a_id INTEGER NOT NULL,
+    b_id INTEGER NOT NULL,
+    name VARCHAR(50) NOT NULL,
+    PRIMARY KEY(c_id)
+);
+
+
+# -----------------------------------------------------------------------
+# d
+# -----------------------------------------------------------------------
+CREATE TABLE d
+(
+    d_id INTEGER NOT NULL,
+    name VARCHAR(255) NOT NULL,
+    b_id INTEGER NOT NULL,
+    a_id INTEGER NOT NULL,
+    PRIMARY KEY(d_id, b_id, a_id)
+);
+
+
+# -----------------------------------------------------------------------
+# nopk
+# -----------------------------------------------------------------------
+CREATE TABLE nopk
+(
+    intcol INTEGER,
+    name VARCHAR(50)
+);
+
+
+# -----------------------------------------------------------------------
+# MULTIPK_SELF_REFTABLE
+# -----------------------------------------------------------------------
+CREATE TABLE MULTIPK_SELF_REFTABLE
+(
+    COL1 DECIMAL NOT NULL,
+    COL2 DECIMAL NOT NULL,
+    PARENT_COL1 DECIMAL NOT NULL,
+    PARENT_COL2 DECIMAL NOT NULL,
+    PRIMARY KEY(COL1, COL2)
+);
+
+
+# -----------------------------------------------------------------------
+# ifc_table
+# -----------------------------------------------------------------------
+CREATE TABLE ifc_table
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+# -----------------------------------------------------------------------
+# ifc_table2
+# -----------------------------------------------------------------------
+CREATE TABLE ifc_table2
+(
+    id INTEGER NOT NULL,
+    name VARCHAR(50),
+    PRIMARY KEY(id)
+);
+
+
+# -----------------------------------------------------------------------
+# INHERITANCE_TEST
+# -----------------------------------------------------------------------
+CREATE TABLE INHERITANCE_TEST
+(
+    INHERITANCE_TEST INTEGER NOT NULL AUTO_INCREMENT,
+    CLASS_NAME CHAR(1),
+    PAYLOAD_PARENT VARCHAR(100) NOT NULL,
+    PAYLOAD_B VARCHAR(100),
+    PAYLOAD_C VARCHAR(100),
+    PAYLOAD_D VARCHAR(100),
+    PRIMARY KEY(INHERITANCE_TEST)
+);
+
+
+# -----------------------------------------------------------------------
+# ext_schema
+# -----------------------------------------------------------------------
+CREATE TABLE ext_schema
+(
+    ext_schema_id INTEGER NOT NULL AUTO_INCREMENT,
+    ext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(ext_schema_id),
+    INDEX index_ext_id(ext_id)
+);
+
+
+# -----------------------------------------------------------------------
+# extext_schema
+# -----------------------------------------------------------------------
+CREATE TABLE extext_schema
+(
+    extext_schema_id INTEGER NOT NULL AUTO_INCREMENT,
+    extext_id INTEGER,
+    test INTEGER NOT NULL,
+    PRIMARY KEY(extext_schema_id)
+);
+
+
+# -----------------------------------------------------------------------
+# torque.qualified_name
+# -----------------------------------------------------------------------
+CREATE TABLE torque.qualified_name
+(
+    id INTEGER,
+    payload VARCHAR(100)
+);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_2
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_1
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_2
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_3
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_2
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1
+    FOREIGN KEY (PARENT_COL1, PARENT_COL2)
+    REFERENCES MULTIPK_SELF_REFTABLE (COL1, COL2);
+
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_FK_1
+    FOREIGN KEY (ext_id)
+    REFERENCES ext (ext_id);
+
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_FK_1
+    FOREIGN KEY (extext_id)
+    REFERENCES extext (extext_id);
+
+ALTER TABLE a
+    ADD CONSTRAINT enum_CHECK
+    CHECK
+    (enum in ('x', 'y', 'z'));
+
+CREATE OR REPLACE VIEW a_b AS
+    SELECT
+    a.a_id AS a_id,
+    a.name AS a_name,
+    b.b_id AS b_id,
+    b.name AS b_name,
+    a.enum AS enum
+    from a join r_ab on a.a_id=r_ab.a_id join b on r_ab.b_id=b.b_id;
+
+

Propchange: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-mysql.sql
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql?rev=1856067&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql (added)
+++ db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql Fri Mar 22 15:32:47 2019
@@ -0,0 +1,400 @@
+## 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.
+##
+-- -----------------------------------------------------------------------
+-- oracle SQL script for schema bookstore
+-- -----------------------------------------------------------------------
+
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_1;
+
+
+ALTER TABLE r_ab
+    DROP CONSTRAINT r_ab_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_1;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_2;
+
+
+ALTER TABLE c
+    DROP CONSTRAINT c_FK_3;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_1;
+
+
+ALTER TABLE d
+    DROP CONSTRAINT d_FK_2;
+
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    DROP CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1;
+
+
+ALTER TABLE ext_schema
+    DROP CONSTRAINT ext_schema_FK_1;
+
+
+ALTER TABLE extext_schema
+    DROP CONSTRAINT extext_schema_FK_1;
+
+
+DROP TABLE a CASCADE CONSTRAINTS;
+DROP SEQUENCE a_SEQ;
+DROP TABLE b CASCADE CONSTRAINTS;
+DROP SEQUENCE b_SEQ;
+DROP TABLE r_ab CASCADE CONSTRAINTS;
+DROP TABLE c CASCADE CONSTRAINTS;
+DROP SEQUENCE c_SEQ;
+DROP TABLE d CASCADE CONSTRAINTS;
+DROP TABLE nopk CASCADE CONSTRAINTS;
+DROP TABLE MULTIPK_SELF_REFTABLE CASCADE CONSTRAINTS;
+DROP TABLE ifc_table CASCADE CONSTRAINTS;
+DROP TABLE ifc_table2 CASCADE CONSTRAINTS;
+DROP TABLE INHERITANCE_TEST CASCADE CONSTRAINTS;
+DROP SEQUENCE INHERITANCE_TEST_SEQ;
+DROP TABLE ext_schema CASCADE CONSTRAINTS;
+DROP SEQUENCE ext_schema_SEQ;
+DROP TABLE extext_schema CASCADE CONSTRAINTS;
+DROP SEQUENCE extext_schema_SEQ;
+DROP TABLE torque.qualified_name CASCADE CONSTRAINTS;
+DROP SEQUENCE torque.qualified_name_SEQ;
+
+-- -----------------------------------------------------------------------
+-- a
+-- -----------------------------------------------------------------------
+CREATE TABLE a
+(
+    a_id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR) default 'a_name' NOT NULL,
+    contactdata VARCHAR2(500 CHAR) NOT NULL,
+    created_at TIMESTAMP(6) default CURRENT_TIMESTAMP NOT NULL,
+    updated_at TIMESTAMP(6) NOT NULL,
+    enum VARCHAR2(50 CHAR) default 'x'
+);
+
+ALTER TABLE a
+    ADD CONSTRAINT a_PK
+    PRIMARY KEY(a_id);
+
+CREATE  INDEX NAME_IDX ON a (name);
+
+CREATE SEQUENCE a_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- b
+-- -----------------------------------------------------------------------
+CREATE TABLE b
+(
+    b_id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR) NOT NULL,
+    CONSTRAINT NAME_UNQ UNIQUE (name)
+);
+
+ALTER TABLE b
+    ADD CONSTRAINT b_PK
+    PRIMARY KEY(b_id);
+
+
+CREATE SEQUENCE b_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- r_ab
+-- -----------------------------------------------------------------------
+CREATE TABLE r_ab
+(
+    a_id NUMBER(10,0)(0) NOT NULL,
+    b_id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR) NOT NULL
+);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_PK
+    PRIMARY KEY(a_id, b_id);
+
+
+
+
+-- -----------------------------------------------------------------------
+-- c
+-- -----------------------------------------------------------------------
+CREATE TABLE c
+(
+    c_id NUMBER(10,0)(0) NOT NULL,
+    a_id NUMBER(10,0)(0) NOT NULL,
+    b_id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR) NOT NULL
+);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_PK
+    PRIMARY KEY(c_id);
+
+
+CREATE SEQUENCE c_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- d
+-- -----------------------------------------------------------------------
+CREATE TABLE d
+(
+    d_id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(255 CHAR) NOT NULL,
+    b_id NUMBER(10,0)(0) NOT NULL,
+    a_id NUMBER(10,0)(0) NOT NULL
+);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_PK
+    PRIMARY KEY(d_id, b_id, a_id);
+
+
+
+
+-- -----------------------------------------------------------------------
+-- nopk
+-- -----------------------------------------------------------------------
+CREATE TABLE nopk
+(
+    intcol NUMBER(10,0)(0),
+    name VARCHAR2(50 CHAR)
+);
+
+
+
+
+
+-- -----------------------------------------------------------------------
+-- MULTIPK_SELF_REFTABLE
+-- -----------------------------------------------------------------------
+CREATE TABLE MULTIPK_SELF_REFTABLE
+(
+    COL1 NUMBER NOT NULL,
+    COL2 NUMBER NOT NULL,
+    PARENT_COL1 NUMBER NOT NULL,
+    PARENT_COL2 NUMBER NOT NULL
+);
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_PK
+    PRIMARY KEY(COL1, COL2);
+
+
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table
+(
+    id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR)
+);
+
+ALTER TABLE ifc_table
+    ADD CONSTRAINT ifc_table_PK
+    PRIMARY KEY(id);
+
+
+
+
+-- -----------------------------------------------------------------------
+-- ifc_table2
+-- -----------------------------------------------------------------------
+CREATE TABLE ifc_table2
+(
+    id NUMBER(10,0)(0) NOT NULL,
+    name VARCHAR2(50 CHAR)
+);
+
+ALTER TABLE ifc_table2
+    ADD CONSTRAINT ifc_table2_PK
+    PRIMARY KEY(id);
+
+
+
+
+-- -----------------------------------------------------------------------
+-- INHERITANCE_TEST
+-- -----------------------------------------------------------------------
+CREATE TABLE INHERITANCE_TEST
+(
+    INHERITANCE_TEST NUMBER(10,0)(0) NOT NULL,
+    CLASS_NAME CHAR(1),
+    PAYLOAD_PARENT VARCHAR2(100 CHAR) NOT NULL,
+    PAYLOAD_B VARCHAR2(100 CHAR),
+    PAYLOAD_C VARCHAR2(100 CHAR),
+    PAYLOAD_D VARCHAR2(100 CHAR)
+);
+
+ALTER TABLE INHERITANCE_TEST
+    ADD CONSTRAINT INHERITANCE_TEST_PK
+    PRIMARY KEY(INHERITANCE_TEST);
+
+
+CREATE SEQUENCE INHERITANCE_TEST_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- ext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE ext_schema
+(
+    ext_schema_id NUMBER(10,0)(0) NOT NULL,
+    ext_id NUMBER(10,0)(0),
+    test NUMBER(10,0)(0) NOT NULL
+);
+
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_PK
+    PRIMARY KEY(ext_schema_id);
+
+CREATE  INDEX index_ext_id ON ext_schema (ext_id);
+
+CREATE SEQUENCE ext_schema_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- extext_schema
+-- -----------------------------------------------------------------------
+CREATE TABLE extext_schema
+(
+    extext_schema_id NUMBER(10,0)(0) NOT NULL,
+    extext_id NUMBER(10,0)(0),
+    test NUMBER(10,0)(0) NOT NULL
+);
+
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_PK
+    PRIMARY KEY(extext_schema_id);
+
+
+CREATE SEQUENCE extext_schema_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+
+-- -----------------------------------------------------------------------
+-- torque.qualified_name
+-- -----------------------------------------------------------------------
+CREATE TABLE torque.qualified_name
+(
+    id NUMBER(10,0)(0),
+    payload VARCHAR2(100 CHAR)
+);
+
+
+
+CREATE SEQUENCE torque.qualified_name_SEQ INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE r_ab
+    ADD CONSTRAINT r_ab_FK_2
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_1
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_2
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE c
+    ADD CONSTRAINT c_FK_3
+    FOREIGN KEY (b_id)
+    REFERENCES b (b_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_1
+    FOREIGN KEY (a_id)
+    REFERENCES a (a_id);
+
+ALTER TABLE d
+    ADD CONSTRAINT d_FK_2
+    FOREIGN KEY (a_id, b_id)
+    REFERENCES r_ab (a_id, b_id);
+
+ALTER TABLE MULTIPK_SELF_REFTABLE
+    ADD CONSTRAINT MULTIPK_SELF_REFTABLE_FK_1
+    FOREIGN KEY (PARENT_COL1, PARENT_COL2)
+    REFERENCES MULTIPK_SELF_REFTABLE (COL1, COL2);
+
+ALTER TABLE ext_schema
+    ADD CONSTRAINT ext_schema_FK_1
+    FOREIGN KEY (ext_id)
+    REFERENCES ext (ext_id);
+
+ALTER TABLE extext_schema
+    ADD CONSTRAINT extext_schema_FK_1
+    FOREIGN KEY (extext_id)
+    REFERENCES extext (extext_id);
+
+ALTER TABLE a
+    ADD CONSTRAINT enum_CHECK
+    CHECK
+    (enum in ('x', 'y', 'z'));
+
+CREATE OR REPLACE VIEW a_b AS
+    SELECT
+    a.a_id AS a_id,
+    a.name AS a_name,
+    b.b_id AS b_id,
+    b.name AS b_name,
+    a.enum AS enum
+    from a join r_ab on a.a_id=r_ab.a_id join b on r_ab.b_id=b.b_id;
+
+COMMENT ON TABLE a IS 'A table';
+
+
+COMMENT ON TABLE b IS 'B table';
+
+
+COMMENT ON TABLE r_ab IS 'r_ab table';
+
+
+COMMENT ON TABLE c IS 'c table contains fk to ar_ab, a and b';
+
+
+COMMENT ON TABLE nopk IS 'this table has no pk';
+
+
+COMMENT ON TABLE ifc_table IS 'this table implements an interface';
+
+
+COMMENT ON TABLE ifc_table2 IS 'this table implements a local interface';
+
+
+COMMENT ON TABLE INHERITANCE_TEST IS 'Table to test inheritance';
+
+
+

Propchange: db/torque/torque4/trunk/torque-templates/src/test/resources/org/apache/torque/templates/expected-schema-oracle.sql
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]