You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by tf...@apache.org on 2010/08/20 17:34:10 UTC
svn commit: r987548 - in
/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb:
./ conf/ outlets/ templates/ templates/derby/ templates/mssql/
templates/mysql/ templates/oracle/ templates/postgresql/
Author: tfischer
Date: Fri Aug 20 15:34:09 2010
New Revision: 987548
URL: http://svn.apache.org/viewvc?rev=987548&view=rev
Log:
added templates for creating databases
Added:
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/control.xml
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/options.properties
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/createdb.xml
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/createdb.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/createdb.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/createdb.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/createdb.vm
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/
db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/createdb.vm
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/control.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/control.xml?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/control.xml (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/control.xml Fri Aug 20 15:34:09 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<control loglevel="info"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
+ xmlns="http://db.apache.org/torque/4.0/generator/configuration">
+
+ <options xsi:type="propertiesOptions" path="options.properties"/>
+
+ <output name="torque.sql.createdb">
+ <filenameOutlet
+ xsi:type="javaOutlet"
+ class="org.apache.torque.generator.outlet.java.ModifySourcenameOutlet">
+ <discardFrom>.</discardFrom>
+ <suffix>-create.sql</suffix>
+ </filenameOutlet>
+ <source xsi:type="fileSource" elements="database">
+ <transformer class="org.apache.torque.templates.transformer.sql.SQLTransformer"/>
+ <include>*schema.xml</include>
+ </source>
+ <outlet name="torque.sql.create.database"/>
+ </output>
+</control>
+
\ No newline at end of file
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/options.properties
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/options.properties?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/options.properties (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/conf/options.properties Fri Aug 20 15:34:09 2010
@@ -0,0 +1,16 @@
+# 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.
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/createdb.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/createdb.xml?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/createdb.xml (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/outlets/createdb.xml Fri Aug 20 15:34:09 2010
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<outlets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://db.apache.org/torque/4.0/generator/configuration http://db.apache.org/torque/4.0/generator/configuration.xsd"
+ xmlns="http://db.apache.org/torque/4.0/generator/configuration">
+ <outlet name="torque.sql.create.database"
+ xsi:type="velocityOutlet"
+ path="${option:database}/createdb.vm">
+ </outlet>
+
+</outlets>
\ No newline at end of file
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/createdb.vm?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/createdb.vm (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/derby/createdb.vm Fri Aug 20 15:34:09 2010
@@ -0,0 +1,17 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements. See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership. The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied. See the License for the
+## specific language governing permissions and limitations
+## under the License.
+-- generate databases for derby : do nothing
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/createdb.vm?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/createdb.vm (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mssql/createdb.vm Fri Aug 20 15:34:09 2010
@@ -0,0 +1,22 @@
+## 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.
+
+USE MASTER;
+
+DROP DATABASE $name;
+
+CREATE DATABASE $name;
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/createdb.vm?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/createdb.vm (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/mysql/createdb.vm Fri Aug 20 15:34:09 2010
@@ -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 database if exists $name;
+create database $name;
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/createdb.vm?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/createdb.vm (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/oracle/createdb.vm Fri Aug 20 15:34:09 2010
@@ -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 database $name;
+-- create database $name;
Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/createdb.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/createdb.vm?rev=987548&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/createdb.vm (added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/createdb/templates/postgresql/createdb.vm Fri Aug 20 15:34:09 2010
@@ -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 database $name;
+create database $name;
---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org