Author: tfischer
Date: Sun Apr  1 15:23:05 2012
New Revision: 1308134

URL: http://svn.apache.org/viewvc?rev=1308134&view=rev
Log:
TORQUE-175: finish view sql generation

Added:
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/view.vm
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/view.vm
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/view.vm
Removed:
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/view.vm
Modified:
    
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml

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=1308134&r1=1308133&r2=1308134&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 Apr  1 15:23:05 2012
@@ -198,7 +198,7 @@
 
   <outlet name="torque.sql.ddl.view"
       xsi:type="velocityOutlet"
-      path="ddl/view.vm">
+      path="ddl/${option:database}/view.vm">
     <mergepoint name="columns">
       <action xsi:type="traverseAllAction" 
           element="column"

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,30 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+DROP VIEW ${name};
+CREATE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,30 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+DROP VIEW ${name} IF EXISTS;
+CREATE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,30 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+DROP VIEW ${name}; 
+CREATE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,29 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+CREATE OR REPLACE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,29 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+CREATE OR REPLACE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file

Added: 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/view.vm
URL: 
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/view.vm?rev=1308134&view=auto
==============================================================================
--- 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/view.vm
 (added)
+++ 
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/view.vm
 Sun Apr  1 15:23:05 2012
@@ -0,0 +1,29 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+  #if (${createSql})##
+${createSql}##
+  #else
+CREATE OR REPLACE VIEW ${name} AS
+    SELECT
+    #set ( $cols = $torqueGen.mergepoint("columns") )
+    #set ( $lastCommaPos = $cols.lastIndexOf(","))
+    #if ($lastCommaPos == -1)${cols}#else${cols.substring(0, 
$lastCommaPos)}#end
+
+    ${sqlSuffix};
+  #end
+#end
\ No newline at end of file



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

Reply via email to