Author: tfischer
Date: Sun Jan 20 19:17:25 2013
New Revision: 1435919
URL: http://svn.apache.org/viewvc?rev=1435919&view=rev
Log:
TORQUE-253: included and external schema files should be used in sql generation
TORQUE-254: views must be dropped before tables are dropped
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/dropView.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropView.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/dropView.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/dropView.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/dropView.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/dropView.vm
Modified:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/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
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=1435919&r1=1435918&r2=1435919&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 Jan 20 19:17:25 2013
@@ -30,10 +30,13 @@
</mergepoint>
<mergepoint name="drop">
<action xsi:type="traverseAllAction"
- element="table"
+ element="all-views/view"
+ outlet="torque.sql.ddl.dropView"/>
+ <action xsi:type="traverseAllAction"
+ element="all-tables/table"
outlet="torque.sql.ddl.dropForeignKeySkipDecider"/>
<action xsi:type="traverseAllAction"
- element="table"
+ element="all-tables/table"
outlet="torque.sql.ddl.dropTableSkipDecider"/>
</mergepoint>
<mergepoint name="createSchema">
@@ -43,22 +46,22 @@
</mergepoint>
<mergepoint name="tables">
<action xsi:type="traverseAllAction"
- element="table"
+ element="all-tables/table"
outlet="torque.sql.ddl.tableSkipDecider"/>
</mergepoint>
<mergepoint name="foreignKeys">
<action xsi:type="traverseAllAction"
- element="table"
+ element="all-tables/table"
outlet="torque.sql.ddl.foreignKeySkipDecider"/>
</mergepoint>
<mergepoint name="views">
<action xsi:type="traverseAllAction"
- element="view"
+ element="all-views/view"
outlet="torque.sql.ddl.view"/>
</mergepoint>
<mergepoint name="comments">
<action xsi:type="traverseAllAction"
- element="table"
+ element="all-tables/table"
outlet="torque.sql.ddl.commentSkipDecider"/>
</mergepoint>
<mergepoint name="databaseEnd" />
@@ -216,6 +219,11 @@
</mergepoint>
</outlet>
+ <outlet name="torque.sql.ddl.dropView"
+ xsi:type="velocityOutlet"
+ path="ddl/${option:database}/dropView.vm">
+ </outlet>
+
<outlet name="torque.sql.ddl.viewColumn"
xsi:type="velocityOutlet"
path="ddl/viewColumn.vm">
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,20 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+DROP VIEW ${name};
+
+#end
Modified:
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=1435919&r1=1435918&r2=1435919&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/view.vm
Sun Jan 20 19:17:25 2013
@@ -18,7 +18,6 @@
#if (${createSql})##
${createSql}##
#else
-DROP VIEW ${name};
CREATE VIEW ${name} AS
SELECT
#set ( $cols = $torqueGen.mergepoint("columns") )
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,20 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+DROP VIEW ${name} IF EXISTS;
+
+#end
Modified:
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=1435919&r1=1435918&r2=1435919&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/view.vm
Sun Jan 20 19:17:25 2013
@@ -18,7 +18,6 @@
#if (${createSql})##
${createSql}##
#else
-DROP VIEW ${name} IF EXISTS;
CREATE VIEW ${name} AS
SELECT
#set ( $cols = $torqueGen.mergepoint("columns") )
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,20 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+#if (!$skipSql.equals("true"))##
+DROP VIEW ${name};
+
+#end
Modified:
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=1435919&r1=1435918&r2=1435919&view=diff
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
(original)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/view.vm
Sun Jan 20 19:17:25 2013
@@ -18,7 +18,6 @@
#if (${createSql})##
${createSql}##
#else
-DROP VIEW ${name};
CREATE VIEW ${name} AS
SELECT
#set ( $cols = $torqueGen.mergepoint("columns") )
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,18 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+## Drop view not necessary in MySQL
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,18 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+## Drop view not necessary in Oracle
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/dropView.vm
URL:
http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/dropView.vm?rev=1435919&view=auto
==============================================================================
---
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/dropView.vm
(added)
+++
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/dropView.vm
Sun Jan 20 19:17:25 2013
@@ -0,0 +1,18 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+## Drop view not necessary in Postgresql
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]