From: <fg...@us...> - 2009-03-29 10:52:09
|
Revision: 1129 http://openutils.svn.sourceforge.net/openutils/?rev=1129&view=rev Author: fgiust Date: 2009-03-29 10:52:04 +0000 (Sun, 29 Mar 2009) Log Message: ----------- updated dependencies Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml trunk/openutils-dbmigration/src/site/changes/changes.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2009-03-29 10:28:58 UTC (rev 1128) +++ trunk/openutils-dbmigration/pom.xml 2009-03-29 10:52:04 UTC (rev 1129) @@ -20,7 +20,7 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>1.3</version> + <version>1.4</version> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -68,7 +68,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.0-FINAL</version> + <version>3.2-FINAL</version> <optional>true</optional> <exclusions> <exclusion> Modified: trunk/openutils-dbmigration/src/site/changes/changes.xml =================================================================== --- trunk/openutils-dbmigration/src/site/changes/changes.xml 2009-03-29 10:28:58 UTC (rev 1128) +++ trunk/openutils-dbmigration/src/site/changes/changes.xml 2009-03-29 10:52:04 UTC (rev 1129) @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<!-- + <!-- "type" attribute can be: add, remove, update or fix. --> <document> @@ -8,19 +8,21 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="2.0.5" date="2009-03-29" description=""> + <action type="update" dev="fgiust">Updated slf4j, spring and poi dependencies</action> + </release> <release version="2.0.4" date="2008-06-11" description="2.0.4"> <action type="fix" dev="fgiust"> Warning: fixed the usage of the "not" condition in it.openutils.migration.task.setup.BaseConditionalTask that previosly caused unexpected (inverted) results. You may need to review your conditional tasks in order to check if the condition is still valid!</action> <action type="add" dev="fgiust">New jdbc generic tasks: IfColumnIsNotIdentityConditionalTask, JdbcIfColumnIsNotNullableConditionalTask, JdbcIfForeignKeyExistsConditionalTask</action> - <action type="add" dev="fgiust">New oracle specific tasks: OraclePackageCreationTask, - OracleStoredProcedureCallTask</action> + <action type="add" dev="fgiust">New oracle specific tasks: OraclePackageCreationTask, OracleStoredProcedureCallTask + </action> </release> <release version="2.0.3" date="2008-02-21" description="2.0.3"> <action type="add" dev="fgiust">New it.openutils.migration.oracle.OracleViewCreateOrUpdateTask</action> - <action type="fix" dev="fgiust">Fix handling of empty strings for numeric types in ExcelConfigurationTask - </action> + <action type="fix" dev="fgiust">Fix handling of empty strings for numeric types in ExcelConfigurationTask</action> <action type="update" dev="fgiust"> Dates are now always processed using an ISO8601 date format in ExcelConfigurationTask (previously the parsing was left to the jdbc driver, leading to different results with different drivers)</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-09-04 09:59:22
|
Revision: 1330 http://openutils.svn.sourceforge.net/openutils/?rev=1330&view=rev Author: fgiust Date: 2009-09-04 09:59:14 +0000 (Fri, 04 Sep 2009) Log Message: ----------- ready for a release Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Added Paths: ----------- trunk/openutils-dbmigration/src/main/assembly/ trunk/openutils-dbmigration/src/main/assembly/assembly-bundle.xml trunk/openutils-dbmigration/src/main/bundle/ trunk/openutils-dbmigration/src/main/bundle/LICENSE.txt trunk/openutils-dbmigration/src/main/bundle/README.txt Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2009-09-02 14:55:16 UTC (rev 1329) +++ trunk/openutils-dbmigration/pom.xml 2009-09-04 09:59:14 UTC (rev 1330) @@ -8,8 +8,24 @@ </parent> <artifactId>openutils-dbmigration</artifactId> <name>openutils db migration</name> + <description> + <![CDATA[ +DB Migration is a framework based on Spring for handling automatic db schema updates. +With DBMigration you can bundle upgrade scripts in you application. Its purpose +is to manage db updates consistently both for development than for production releases. + ]]></description> <version>2.0.7-SNAPSHOT</version> - <description /> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + <url>http://lab.openmindonline.it/lab/products/dbmigration.html</url> + <issueManagement> + <system>jira</system> + <url>http://lab.openmindonline.it/jira/browse/DBMIGRATION</url> + </issueManagement> <dependencies> <dependency> <groupId>commons-lang</groupId> @@ -94,6 +110,27 @@ </exclusions> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>bundle</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> + </descriptors> + </configuration> + </plugin> + </plugins> + </build> <properties> <spring.version>2.5.6</spring.version> </properties> Added: trunk/openutils-dbmigration/src/main/assembly/assembly-bundle.xml =================================================================== --- trunk/openutils-dbmigration/src/main/assembly/assembly-bundle.xml (rev 0) +++ trunk/openutils-dbmigration/src/main/assembly/assembly-bundle.xml 2009-09-04 09:59:14 UTC (rev 1330) @@ -0,0 +1,26 @@ +<assembly> + <id>bundle</id> + <formats> + <format>zip</format> + </formats> + <includeBaseDirectory>false</includeBaseDirectory> + <fileSets> + <fileSet> + <filtered>true</filtered> + <outputDirectory>/</outputDirectory> + <lineEnding>crlf</lineEnding> + <directory>${basedir}/src/main/bundle</directory> + <includes> + <include>*</include> + </includes> + </fileSet> + </fileSets> + <dependencySets> + <dependencySet> + <outputDirectory>${pom.artifactId}</outputDirectory> + <includes> + <include>net.sourceforge.openutils:*</include> + </includes> + </dependencySet> + </dependencySets> +</assembly> \ No newline at end of file Property changes on: trunk/openutils-dbmigration/src/main/assembly/assembly-bundle.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-dbmigration/src/main/bundle/LICENSE.txt =================================================================== --- trunk/openutils-dbmigration/src/main/bundle/LICENSE.txt (rev 0) +++ trunk/openutils-dbmigration/src/main/bundle/LICENSE.txt 2009-09-04 09:59:14 UTC (rev 1330) @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. Property changes on: trunk/openutils-dbmigration/src/main/bundle/LICENSE.txt ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Added: trunk/openutils-dbmigration/src/main/bundle/README.txt =================================================================== --- trunk/openutils-dbmigration/src/main/bundle/README.txt (rev 0) +++ trunk/openutils-dbmigration/src/main/bundle/README.txt 2009-09-04 09:59:14 UTC (rev 1330) @@ -0,0 +1,67 @@ +=========================================================== + +${pom.name} ${pom.version} +by ${pom.organization.name} + +=========================================================== + +${pom.description} + +More information about this project can be found at: +${pom.url} + +Change log and known issues can be found at: +${pom.issueManagement.url} + +Source is available from the subversion repository at: +${pom.scm.url} + +========================================= + USAGE +========================================= + +The preferred way to add ${pom.name} to your project is using maven. +You can declare the following dependency in your pom.xml: + + <dependency> + <groupId>${pom.artifactId}</groupId> + <artifactId>${pom.groupId}</artifactId> + <version>${pom.version}</version> + </dependency> + +Alternatively, you can add the ${pom.artifactId} plus the required dependencies +manually to the classpath of your application: + +========================================= + DEPENDENCIES LIST +========================================= + +${pom.artifactId} requires: + +LIBRARY VERSION +commons-lang 2.4 +commons-io 1.4 +spring-jdbc 2.5.x +spring-beans 2.5.x +spring-core 2.5.x +poi 3.2-FINAL (optional) + + +========================================= + LICENSE +========================================= + +Copyright Openmind http://www.openmindonline.it + +Licensed 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. + Property changes on: trunk/openutils-dbmigration/src/main/bundle/README.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-09-04 10:21:02
|
Revision: 1332 http://openutils.svn.sourceforge.net/openutils/?rev=1332&view=rev Author: fgiust Date: 2009-09-04 10:20:56 +0000 (Fri, 04 Sep 2009) Log Message: ----------- [maven-release-plugin] prepare release openutils-dbmigration-2.0.7 Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Added Paths: ----------- trunk/openutils-dbmigration/release-pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2009-09-04 10:18:29 UTC (rev 1331) +++ trunk/openutils-dbmigration/pom.xml 2009-09-04 10:20:56 UTC (rev 1332) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>net.sourceforge.openutils</groupId> @@ -14,7 +13,7 @@ With DBMigration you can bundle upgrade scripts in you application. Its purpose is to manage db updates consistently both for development than for production releases. ]]></description> - <version>2.0.7-SNAPSHOT</version> + <version>2.0.7</version> <licenses> <license> <name>The Apache Software License, Version 2.0</name> @@ -134,4 +133,10 @@ <properties> <spring.version>2.5.6</spring.version> </properties> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.7</url> + </scm> </project> \ No newline at end of file Added: trunk/openutils-dbmigration/release-pom.xml =================================================================== --- trunk/openutils-dbmigration/release-pom.xml (rev 0) +++ trunk/openutils-dbmigration/release-pom.xml 2009-09-04 10:20:56 UTC (rev 1332) @@ -0,0 +1,376 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-dbmigration</artifactId> + <version>2.0.7</version> + <name>openutils db migration</name> + <description>DB Migration is a framework based on Spring for handling automatic db schema updates. +With DBMigration you can bundle upgrade scripts in you application. Its purpose +is to manage db updates consistently both for development than for production releases.</description> + <url>http://lab.openmindonline.it/lab/products/dbmigration.html</url> + <organization> + <name>Openmind</name> + <url>http://www.openmindonline.it</url> + </organization> + <licenses> + <license> + <name>The Apache Software License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + <developers> + <developer> + <id>fgiust</id> + <name>Fabrizio Giustina</name> + <email>fg...@ap...</email> + <organization>openmind</organization> + <roles> + <role>Project admin and developer</role> + </roles> + <timezone>+1</timezone> + </developer> + <developer> + <id>ronya_z</id> + <name>Daniela Fuscio</name> + <email>dan...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> + <developer> + <id>molask</id> + <name>Manuel Molaschi</name> + <email>man...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> + <developer> + <id>fcarone</id> + <name>Filippo Carone</name> + <email>fil...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> + <developer> + <id>fberar</id> + <name>Fabrizio Berardi</name> + <email>fab...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> + <developer> + <id>fgrilli</id> + <name>Federico Grilli</name> + <email>fed...@op...</email> + <organization>openmind</organization> + <roles> + <role>developer</role> + </roles> + <timezone>+1</timezone> + </developer> + </developers> + <issueManagement> + <system>jira</system> + <url>http://lab.openmindonline.it/jira/browse/DBMIGRATION</url> + </issueManagement> + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.7</url> + </scm> + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> + <testSourceDirectory>src/test/java</testSourceDirectory> + <outputDirectory>target/classes</outputDirectory> + <testOutputDirectory>target/test-classes</testOutputDirectory> + <resources> + <resource> + <mergeId>resource-0</mergeId> + <directory>src/main/resources</directory> + </resource> + </resources> + <testResources> + <testResource> + <mergeId>resource-1</mergeId> + <directory>src/test/resources</directory> + </testResource> + </testResources> + <directory>target</directory> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>2.3</version> + <configuration> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>2.0-beta-7</version> + <configuration> + <stagingSiteURL>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/staging/${pom.artifactId}/ + </stagingSiteURL> + </configuration> + </plugin> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <version>2.0-beta-8</version> + <configuration> + <generateReleasePoms>true</generateReleasePoms> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.3</version> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>2.0.2</version> + <configuration> + <source>1.5</source> + <target>1.5</target> + <encoding>UTF-8</encoding> + </configuration> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>2.0.4</version> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.4</version> + </plugin> + <plugin> + <artifactId>maven-eclipse-plugin</artifactId> + <version>2.5.1</version> + <configuration> + <wtpversion>1.5</wtpversion> + <additionalBuildcommands> + <additionalBuildcommand>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</additionalBuildcommand> + </additionalBuildcommands> + <additionalProjectnatures> + <additionalProjectnature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</additionalProjectnature> + </additionalProjectnatures> + <additionalConfig> + <file> + <name>.checkstyle</name> + <content> + <![CDATA[<fileset-config file-format-version="1.2.0" simple-config="true"> + <fileset name="all" enabled="true" check-config-name="project" local="false"> + <file-match-pattern match-pattern="." include-pattern="true" /> + </fileset> + <filter name="NonSrcDirs" enabled="true" /> +</fileset-config>]]> + </content> + </file> + </additionalConfig> + </configuration> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>2.2-beta-2</version> + <executions> + <execution> + <id>bundle</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <descriptors> + <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> + </descriptors> + </configuration> + </plugin> + </plugins> + </build> + <distributionManagement> + <repository> + <id>openutils</id> + <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/repository/releases</url> + </repository> + <snapshotRepository> + <id>openutils.snapshots</id> + <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/repository/snapshots</url> + </snapshotRepository> + <site> + <id>sourceforge</id> + <name>sourceforge</name> + <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/openutils-dbmigration</url> + </site> + <downloadUrl>http://prdownloads.sourceforge.net/150467</downloadUrl> + </distributionManagement> + <repositories> + <repository> + <snapshots> + <enabled>false</enabled> + </snapshots> + <id>central</id> + <name>Maven Repository Switchboard</name> + <url>http://repo1.maven.org/maven2</url> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + <id>central</id> + <name>Maven Plugin Repository</name> + <url>http://repo1.maven.org/maven2</url> + </pluginRepository> + </pluginRepositories> + <dependencies> + <dependency> + <groupId>aopalliance</groupId> + <artifactId>aopalliance</artifactId> + <version>1.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>1.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + <version>3.2-FINAL</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>1.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>1.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-beans</artifactId> + <version>2.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>2.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-core</artifactId> + <version>2.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-jdbc</artifactId> + <version>2.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-tx</artifactId> + <version>2.5.6</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <version>5.1</version> + <classifier>jdk15</classifier> + <scope>test</scope> + </dependency> + </dependencies> + <reporting> + <excludeDefaults>false</excludeDefaults> + <outputDirectory>target/site</outputDirectory> + <plugins> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>2.4</version> + <configuration> + <quiet>true</quiet> + </configuration> + </plugin> + <plugin> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> + <artifactId>maven-changes-plugin</artifactId> + <version>2.0-beta-3</version> + <configuration> + <xmlPath>/data/apps/openutils/code/openutils-parent/src/site/changes/changes.xml</xmlPath> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>changes-report</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <artifactId>maven-surefire-report-plugin</artifactId> + <version>2.4.3</version> + </plugin> + <plugin> + <artifactId>maven-changelog-plugin</artifactId> + <version>2.1</version> + </plugin> + <plugin> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.1</version> + </plugin> + </plugins> + </reporting> + <properties> + <google.webtoolkit.home>/opt/gwt</google.webtoolkit.home> + <spring.version>2.5.6</spring.version> + <surefire.useFile>false</surefire.useFile> + <wtpversion>1.5</wtpversion> + <passphrase>set me</passphrase> + </properties> +</project> Property changes on: trunk/openutils-dbmigration/release-pom.xml ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2009-09-04 10:21:53
|
Revision: 1334 http://openutils.svn.sourceforge.net/openutils/?rev=1334&view=rev Author: fgiust Date: 2009-09-04 10:21:45 +0000 (Fri, 04 Sep 2009) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml Removed Paths: ------------- trunk/openutils-dbmigration/release-pom.xml Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2009-09-04 10:21:28 UTC (rev 1333) +++ trunk/openutils-dbmigration/pom.xml 2009-09-04 10:21:45 UTC (rev 1334) @@ -13,7 +13,7 @@ With DBMigration you can bundle upgrade scripts in you application. Its purpose is to manage db updates consistently both for development than for production releases. ]]></description> - <version>2.0.7</version> + <version>2.0.8-SNAPSHOT</version> <licenses> <license> <name>The Apache Software License, Version 2.0</name> @@ -133,10 +133,4 @@ <properties> <spring.version>2.5.6</spring.version> </properties> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.7</url> - </scm> </project> \ No newline at end of file Deleted: trunk/openutils-dbmigration/release-pom.xml =================================================================== --- trunk/openutils-dbmigration/release-pom.xml 2009-09-04 10:21:28 UTC (rev 1333) +++ trunk/openutils-dbmigration/release-pom.xml 2009-09-04 10:21:45 UTC (rev 1334) @@ -1,376 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <modelVersion>4.0.0</modelVersion> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-dbmigration</artifactId> - <version>2.0.7</version> - <name>openutils db migration</name> - <description>DB Migration is a framework based on Spring for handling automatic db schema updates. -With DBMigration you can bundle upgrade scripts in you application. Its purpose -is to manage db updates consistently both for development than for production releases.</description> - <url>http://lab.openmindonline.it/lab/products/dbmigration.html</url> - <organization> - <name>Openmind</name> - <url>http://www.openmindonline.it</url> - </organization> - <licenses> - <license> - <name>The Apache Software License, Version 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> - </license> - </licenses> - <developers> - <developer> - <id>fgiust</id> - <name>Fabrizio Giustina</name> - <email>fg...@ap...</email> - <organization>openmind</organization> - <roles> - <role>Project admin and developer</role> - </roles> - <timezone>+1</timezone> - </developer> - <developer> - <id>ronya_z</id> - <name>Daniela Fuscio</name> - <email>dan...@op...</email> - <organization>openmind</organization> - <roles> - <role>developer</role> - </roles> - <timezone>+1</timezone> - </developer> - <developer> - <id>molask</id> - <name>Manuel Molaschi</name> - <email>man...@op...</email> - <organization>openmind</organization> - <roles> - <role>developer</role> - </roles> - <timezone>+1</timezone> - </developer> - <developer> - <id>fcarone</id> - <name>Filippo Carone</name> - <email>fil...@op...</email> - <organization>openmind</organization> - <roles> - <role>developer</role> - </roles> - <timezone>+1</timezone> - </developer> - <developer> - <id>fberar</id> - <name>Fabrizio Berardi</name> - <email>fab...@op...</email> - <organization>openmind</organization> - <roles> - <role>developer</role> - </roles> - <timezone>+1</timezone> - </developer> - <developer> - <id>fgrilli</id> - <name>Federico Grilli</name> - <email>fed...@op...</email> - <organization>openmind</organization> - <roles> - <role>developer</role> - </roles> - <timezone>+1</timezone> - </developer> - </developers> - <issueManagement> - <system>jira</system> - <url>http://lab.openmindonline.it/jira/browse/DBMIGRATION</url> - </issueManagement> - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-dbmigration-2.0.7</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-dbmigration-2.0.7</url> - </scm> - <build> - <sourceDirectory>src/main/java</sourceDirectory> - <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> - <testSourceDirectory>src/test/java</testSourceDirectory> - <outputDirectory>target/classes</outputDirectory> - <testOutputDirectory>target/test-classes</testOutputDirectory> - <resources> - <resource> - <mergeId>resource-0</mergeId> - <directory>src/main/resources</directory> - </resource> - </resources> - <testResources> - <testResource> - <mergeId>resource-1</mergeId> - <directory>src/test/resources</directory> - </testResource> - </testResources> - <directory>target</directory> - <plugins> - <plugin> - <artifactId>maven-resources-plugin</artifactId> - <version>2.3</version> - <configuration> - <encoding>UTF-8</encoding> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>2.0-beta-7</version> - <configuration> - <stagingSiteURL>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/staging/${pom.artifactId}/ - </stagingSiteURL> - </configuration> - </plugin> - <plugin> - <artifactId>maven-release-plugin</artifactId> - <version>2.0-beta-8</version> - <configuration> - <generateReleasePoms>true</generateReleasePoms> - </configuration> - </plugin> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <version>2.4.3</version> - </plugin> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <version>2.0.2</version> - <configuration> - <source>1.5</source> - <target>1.5</target> - <encoding>UTF-8</encoding> - </configuration> - </plugin> - <plugin> - <artifactId>maven-source-plugin</artifactId> - <version>2.0.4</version> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.4</version> - </plugin> - <plugin> - <artifactId>maven-eclipse-plugin</artifactId> - <version>2.5.1</version> - <configuration> - <wtpversion>1.5</wtpversion> - <additionalBuildcommands> - <additionalBuildcommand>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</additionalBuildcommand> - </additionalBuildcommands> - <additionalProjectnatures> - <additionalProjectnature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</additionalProjectnature> - </additionalProjectnatures> - <additionalConfig> - <file> - <name>.checkstyle</name> - <content> - <![CDATA[<fileset-config file-format-version="1.2.0" simple-config="true"> - <fileset name="all" enabled="true" check-config-name="project" local="false"> - <file-match-pattern match-pattern="." include-pattern="true" /> - </fileset> - <filter name="NonSrcDirs" enabled="true" /> -</fileset-config>]]> - </content> - </file> - </additionalConfig> - </configuration> - </plugin> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <version>2.2-beta-2</version> - <executions> - <execution> - <id>bundle</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - <configuration> - <descriptors> - <descriptor>${basedir}/src/main/assembly/assembly-bundle.xml</descriptor> - </descriptors> - </configuration> - </plugin> - </plugins> - </build> - <distributionManagement> - <repository> - <id>openutils</id> - <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/repository/releases</url> - </repository> - <snapshotRepository> - <id>openutils.snapshots</id> - <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/repository/snapshots</url> - </snapshotRepository> - <site> - <id>sourceforge</id> - <name>sourceforge</name> - <url>scp://shell.sourceforge.net/home/groups/o/op/openutils/htdocs/openutils-dbmigration</url> - </site> - <downloadUrl>http://prdownloads.sourceforge.net/150467</downloadUrl> - </distributionManagement> - <repositories> - <repository> - <snapshots> - <enabled>false</enabled> - </snapshots> - <id>central</id> - <name>Maven Repository Switchboard</name> - <url>http://repo1.maven.org/maven2</url> - </repository> - </repositories> - <pluginRepositories> - <pluginRepository> - <releases> - <updatePolicy>never</updatePolicy> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - <id>central</id> - <name>Maven Plugin Repository</name> - <url>http://repo1.maven.org/maven2</url> - </pluginRepository> - </pluginRepositories> - <dependencies> - <dependency> - <groupId>aopalliance</groupId> - <artifactId>aopalliance</artifactId> - <version>1.0</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>1.4</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.apache.poi</groupId> - <artifactId>poi</artifactId> - <version>3.2-FINAL</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> - <version>1.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-api</artifactId> - <version>1.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-beans</artifactId> - <version>2.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-context</artifactId> - <version>2.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>2.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-jdbc</artifactId> - <version>2.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-tx</artifactId> - <version>2.5.6</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>5.1</version> - <classifier>jdk15</classifier> - <scope>test</scope> - </dependency> - </dependencies> - <reporting> - <excludeDefaults>false</excludeDefaults> - <outputDirectory>target/site</outputDirectory> - <plugins> - <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - <version>2.4</version> - <configuration> - <quiet>true</quiet> - </configuration> - </plugin> - <plugin> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <artifactId>maven-changes-plugin</artifactId> - <version>2.0-beta-3</version> - <configuration> - <xmlPath>/data/apps/openutils/code/openutils-parent/src/site/changes/changes.xml</xmlPath> - </configuration> - <reportSets> - <reportSet> - <reports> - <report>changes-report</report> - </reports> - </reportSet> - </reportSets> - </plugin> - <plugin> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.3</version> - </plugin> - <plugin> - <artifactId>maven-changelog-plugin</artifactId> - <version>2.1</version> - </plugin> - <plugin> - <artifactId>maven-jxr-plugin</artifactId> - <version>2.1</version> - </plugin> - </plugins> - </reporting> - <properties> - <google.webtoolkit.home>/opt/gwt</google.webtoolkit.home> - <spring.version>2.5.6</spring.version> - <surefire.useFile>false</surefire.useFile> - <wtpversion>1.5</wtpversion> - <passphrase>set me</passphrase> - </properties> -</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2016-04-03 20:06:43
|
Revision: 4636 http://openutils.svn.sourceforge.net/openutils/?rev=4636&view=rev Author: fgiust Date: 2016-04-03 20:06:40 +0000 (Sun, 03 Apr 2016) Log Message: ----------- upgrade spring version Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DefaultDbVersionManagerImpl.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleStoredProcedureCallTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ScriptBasedUnconditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/update/ScriptBasedDbUpdate.java Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/pom.xml 2016-04-03 20:06:40 UTC (rev 4636) @@ -148,6 +148,6 @@ </plugins> </build> <properties> - <spring.version>3.0.0.RELEASE</spring.version> + <spring.version>4.2.5.RELEASE</spring.version> </properties> </project> \ No newline at end of file Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,9 +18,6 @@ package it.openutils.migration; -import it.openutils.migration.task.setup.DbTask; -import it.openutils.migration.task.update.DbUpdate; - import java.util.Comparator; import java.util.List; import java.util.Set; @@ -36,7 +33,10 @@ import org.springframework.transaction.support.TransactionCallbackWithoutResult; import org.springframework.transaction.support.TransactionTemplate; +import it.openutils.migration.task.setup.DbTask; +import it.openutils.migration.task.update.DbUpdate; + /** * DB setup manager: handles db setup and upgrade. * @author fgiust Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DefaultDbVersionManagerImpl.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DefaultDbVersionManagerImpl.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DefaultDbVersionManagerImpl.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -21,7 +21,7 @@ import javax.sql.DataSource; import org.springframework.dao.EmptyResultDataAccessException; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; /** @@ -95,11 +95,11 @@ */ public int getCurrentVersion() { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); int initialVersion = 0; try { - initialVersion = jdbcTemplate.queryForInt(versionQuery); + initialVersion = jdbcTemplate.queryForObject(versionCreate, Integer.class); } catch (EmptyResultDataAccessException e) { @@ -113,7 +113,7 @@ */ public void setNewVersion(int version) { - new SimpleJdbcTemplate(dataSource).update(versionUpdate, version); + new JdbcTemplate(dataSource).update(versionUpdate, version); } } Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -31,9 +29,11 @@ import org.apache.commons.lang.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Base conditional task that operates on conditions related to a specific column. This base task takes care of * retrieving the column metadata, so that subclasses only need to override <code>checkColumnMetadata()</code>. @@ -89,14 +89,14 @@ * {@inheritDoc} */ @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { String columnTrim = StringUtils.trim(column); final String tableName = StringUtils.substringBefore(columnTrim, "."); final String columnName = StringUtils.substringAfter(columnTrim, "."); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + return (Boolean) jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection con) throws SQLException, DataAccessException @@ -136,14 +136,14 @@ * qualified</li> * <li><strong>COLUMN_SIZE</strong> int => column size.</li> * <li><strong>BUFFER_LENGTH</strong> is not used.</li> - * <li><strong>DECIMAL_DIGITS</strong> int => the number of fractional digits. Null is returned for data types - * where DECIMAL_DIGITS is not applicable.</li> + * <li><strong>DECIMAL_DIGITS</strong> int => the number of fractional digits. Null is returned for data types where + * DECIMAL_DIGITS is not applicable.</li> * <li><strong>NUM_PREC_RADIX</strong> int => Radix (typically either 10 or 2)</li> * <li><strong>NULLABLE</strong> int => is NULL allowed.</li> * <ul> - * <li> columnNoNulls - might not allow <code>NULL</code> values</li> - * <li> columnNullable - definitely allows <code>NULL</code> values</li> - * <li> columnNullableUnknown - nullability unknown</li> + * <li>columnNoNulls - might not allow <code>NULL</code> values</li> + * <li>columnNullable - definitely allows <code>NULL</code> values</li> + * <li>columnNullableUnknown - nullability unknown</li> * </ul> * <li><strong>REMARKS</strong> String => comment describing column (may be <code>null</code>)</li> * <li><strong>COLUMN_DEF</strong> String => default value for the column, which should be interpreted as a string @@ -154,23 +154,23 @@ * <li><strong>ORDINAL_POSITION</strong> int => index of column in table (starting at 1)</li> * <li><strong>IS_NULLABLE</strong> String => ISO rules are used to determine the nullability for a column.</li> * <ul> - * <li> YES --- if the parameter can include NULLs</li> - * <li> NO --- if the parameter cannot include NULLs</li> - * <li> empty string --- if the nullability for the parameter is unknown</li> + * <li>YES --- if the parameter can include NULLs</li> + * <li>NO --- if the parameter cannot include NULLs</li> + * <li>empty string --- if the nullability for the parameter is unknown</li> * </ul> - * <li><strong>SCOPE_CATLOG</strong> String => catalog of table that is the scope of a reference attribute (<code>null</code> - * if DATA_TYPE isn't REF)</li> - * <li><strong>SCOPE_SCHEMA</strong> String => schema of table that is the scope of a reference attribute (<code>null</code> - * if the DATA_TYPE isn't REF)</li> - * <li><strong>SCOPE_TABLE</strong> String => table name that this the scope of a reference attribure (<code>null</code> - * if the DATA_TYPE isn't REF)</li> + * <li><strong>SCOPE_CATLOG</strong> String => catalog of table that is the scope of a reference attribute ( + * <code>null</code> if DATA_TYPE isn't REF)</li> + * <li><strong>SCOPE_SCHEMA</strong> String => schema of table that is the scope of a reference attribute ( + * <code>null</code> if the DATA_TYPE isn't REF)</li> + * <li><strong>SCOPE_TABLE</strong> String => table name that this the scope of a reference attribure ( + * <code>null</code> if the DATA_TYPE isn't REF)</li> * <li><strong>SOURCE_DATA_TYPE</strong> short => source type of a distinct type or user-generated Ref type, SQL * type from java.sql.Types (<code>null</code> if DATA_TYPE isn't DISTINCT or user-generated REF)</li> * <li><strong>IS_AUTOINCREMENT</strong> String => Indicates whether this column is auto incremented</li> * <ul> - * <li> YES --- if the column is auto incremented</li> - * <li> NO --- if the column is not auto incremented</li> - * <li> empty string --- if it cannot be determined whether the column is auto incremented parameter is unknown</li> + * <li>YES --- if the column is auto incremented</li> + * <li>NO --- if the column is not auto incremented</li> + * <li>empty string --- if it cannot be determined whether the column is auto incremented parameter is unknown</li> * </ul> * </ol> * @param metadata column metadata Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -28,9 +26,11 @@ import org.apache.commons.lang.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Task that executes if a given column exists. * @author fgiust @@ -85,14 +85,14 @@ * {@inheritDoc} */ @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { String columnTrim = StringUtils.trim(column); final String tableName = StringUtils.substringBefore(columnTrim, "."); final String columnName = StringUtils.substringAfter(columnTrim, "."); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + return (Boolean) jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection con) throws SQLException, DataAccessException Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -38,9 +36,11 @@ import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Task that executes if a given column have at least one index. * @author Antonio Gagliardi @@ -111,7 +111,7 @@ */ @SuppressWarnings("unchecked") @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { Set<IndexItem> indexExpected = new TreeSet<IndexItem>(); @@ -143,8 +143,7 @@ return indexs.values(); } }; - Collection<Set<IndexItem>> indexs = (Collection<Set<IndexItem>>) jdbcTemplate.getJdbcOperations().execute( - action); + Collection<Set<IndexItem>> indexs = (Collection<Set<IndexItem>>) jdbcTemplate.execute(action); log.debug("Expected:{}", asString(indexExpected)); for (Set<IndexItem> index : indexs) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -20,7 +20,9 @@ import java.util.Map; +import org.apache.commons.lang.StringUtils; + /** * Task that executes if a given column is not nullable (IS_NULLABLE = NO). * @author fgiust @@ -36,7 +38,7 @@ protected boolean checkColumnMetadata(Map<String, Object> metadata) { - String isNullable = (String) metadata.get("IS_NULLABLE"); - return "NO".equals(isNullable); + String isNullable = StringUtils.trim((String) metadata.get("IS_NULLABLE")); + return "NO".equalsIgnoreCase(isNullable); } } Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -28,9 +26,11 @@ import org.apache.commons.lang.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Task that executes if a named foreign key eists. * @author fgiust @@ -76,14 +76,14 @@ * {@inheritDoc} */ @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { String fkNameTrim = StringUtils.trim(fkName); final String tableName = StringUtils.substringBefore(fkNameTrim, "."); final String fkName = StringUtils.substringAfter(fkNameTrim, "."); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + return (Boolean) jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection con) throws SQLException, DataAccessException Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -33,9 +31,11 @@ import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Task that executes if a given column have at least one index. * @author Antonio Gagliardi @@ -60,7 +60,7 @@ */ @SuppressWarnings("unchecked") @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { checkInputs(); @@ -83,7 +83,7 @@ return primaryKey.values(); } }; - Collection<String> primaryKeyActual = (Collection<String>) jdbcTemplate.getJdbcOperations().execute(action); + Collection<String> primaryKeyActual = (Collection<String>) jdbcTemplate.execute(action); log.debug("Actual:{}", asString(primaryKeyActual)); if (primaryKeyActual.isEmpty()) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.BaseConditionalTask; - import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -28,9 +26,11 @@ import org.apache.commons.lang.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseConditionalTask; + /** * Task that executes if a given table exists. * @author fgiust @@ -72,7 +72,6 @@ this.schema = schema; } - /** * Sets the table. * @param table the table to set @@ -86,12 +85,12 @@ * {@inheritDoc} */ @Override - public boolean check(SimpleJdbcTemplate jdbcTemplate) + public boolean check(JdbcTemplate jdbcTemplate) { final String tableName = StringUtils.trim(table); - return (Boolean) jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + return (Boolean) jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection con) throws SQLException, DataAccessException Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.generic; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.io.IOException; import java.io.InputStream; import java.sql.Connection; @@ -35,9 +33,10 @@ import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * @author fgiust * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ @@ -81,7 +80,7 @@ @Override public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.oracle; -import it.openutils.migration.task.setup.DbTask; - import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -32,9 +30,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.DbTask; + /** * Db tasks that handles the initial setup of packages. * @author quario @@ -110,7 +110,7 @@ */ public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { @@ -143,11 +143,12 @@ if (StringUtils.isNotBlank(owner)) { - result = jdbcTemplate.queryForInt(selectAllPackages, new Object[]{packageName, owner }); + result = jdbcTemplate + .queryForObject(selectAllPackages, Integer.class, new Object[]{packageName, owner }); } else { - result = jdbcTemplate.queryForInt(selectUserPackages, packageName); + result = jdbcTemplate.queryForObject(selectUserPackages, Integer.class, packageName); } if (result <= 0) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.oracle; -import it.openutils.migration.task.setup.DbTask; - import java.text.MessageFormat; import java.util.List; @@ -28,9 +26,11 @@ import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.DbTask; + /** * Db tasks that handles the initial setup of sequences. * @author fgiust @@ -112,7 +112,7 @@ */ public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (String sequenceName : sequences) { int result = 0; @@ -120,19 +120,19 @@ if (StringUtils.contains(sequenceName, ".")) { String[] tokens = StringUtils.split(sequenceName, "."); - result = jdbcTemplate.queryForInt(selectAllSequences, new Object[]{tokens[1], tokens[0] }); + result = jdbcTemplate + .queryForObject(selectAllSequences, Integer.class, new Object[]{tokens[1], tokens[0] }); } else { - result = jdbcTemplate.queryForInt(selectUserSequences, sequenceName); + result = jdbcTemplate.queryForObject(selectUserSequences, Integer.class, sequenceName); } if (result <= 0) { log.info("Creating new {}", sequenceName); - jdbcTemplate.update(MessageFormat.format(creationQuery, new Object[]{ - sequenceName, - String.valueOf(startsWith) })); + jdbcTemplate.update( + MessageFormat.format(creationQuery, new Object[]{sequenceName, String.valueOf(startsWith) })); } } } Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleStoredProcedureCallTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleStoredProcedureCallTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleStoredProcedureCallTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,24 +18,24 @@ package it.openutils.migration.oracle; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.sql.CallableStatement; import java.sql.Connection; import java.sql.SQLException; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.support.JdbcUtils; +import it.openutils.migration.task.setup.GenericConditionalTask; + public class OracleStoredProcedureCallTask extends GenericConditionalTask { @Override - protected void executeSingle(SimpleJdbcTemplate jdbcTemplate, final String scriptContent) + protected void executeSingle(JdbcTemplate jdbcTemplate, final String scriptContent) { - jdbcTemplate.getJdbcOperations().execute(new ConnectionCallback() + jdbcTemplate.execute(new ConnectionCallback() { public Object doInConnection(Connection con) throws SQLException, DataAccessException { Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,16 +18,16 @@ package it.openutils.migration.oracle; +import org.apache.commons.lang.StringUtils; +import org.springframework.jdbc.core.JdbcTemplate; + import it.openutils.migration.task.setup.GenericConditionalTask; -import org.apache.commons.lang.StringUtils; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; - public class OracleTriggerTask extends GenericConditionalTask { @Override - protected void executeSingle(SimpleJdbcTemplate jdbcTemplate, final String scriptContent) + protected void executeSingle(JdbcTemplate jdbcTemplate, final String scriptContent) { if (StringUtils.isNotBlank(scriptContent)) { Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.oracle; -import it.openutils.migration.task.setup.DbTask; - import java.io.IOException; import java.io.InputStream; import java.text.MessageFormat; @@ -34,9 +32,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.DbTask; + /** * <p> * Db tasks that handles the initial setup of views. @@ -45,8 +45,8 @@ * Limitations: * </p> * <ol> - * <li> * not supported in field list</li> - * <li> fields must be enclosed in quotes</li> + * <li>* not supported in field list</li> + * <li>fields must be enclosed in quotes</li> * </ol> * @author albertoq * @version $Id$ @@ -110,12 +110,12 @@ public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { String viewName = this.objectNameFromFileName(script); - int result = jdbcTemplate.queryForInt(this.selectUserViewExistence, viewName); + int result = jdbcTemplate.queryForObject(this.selectUserViewExistence, Integer.class, viewName); String scriptContent = readFully(script); @@ -138,10 +138,8 @@ continue; } - String previousDDl = (String) jdbcTemplate.getJdbcOperations().queryForObject( - this.selectUserViewDDL, - new Object[]{viewName }, - String.class); + String previousDDl = jdbcTemplate + .queryForObject(this.selectUserViewDDL, new Object[]{viewName }, String.class); if (!StringUtils.equals(previousDDl.trim(), scriptBody.trim())) { @@ -182,7 +180,7 @@ * @param script * @return */ - private void createView(SimpleJdbcTemplate jdbcTemplate, String script) + private void createView(JdbcTemplate jdbcTemplate, String script) { String[] ddls = StringUtils.split(script, ";"); Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -17,8 +17,6 @@ */ package it.openutils.migration.postgres; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; @@ -32,7 +30,9 @@ import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * This is just a patch to move sequences after inserting values from dbMigration. The real solution should be to have * all the database objects generated by dbMigration and not by hibernate. THIS TASK IS NOT CLUSTER SAFE NOR THREAD @@ -107,31 +107,31 @@ }); for (String tableName : tables) { - if (jdbcTemplate - .queryForLong("SELECT COUNT(*) FROM information_schema.sequences WHERE SEQUENCE_NAME ILIKE '" + if (jdbcTemplate.queryForObject( + "SELECT COUNT(*) FROM information_schema.sequences WHERE SEQUENCE_NAME ILIKE '" + tableName - + "_id_seq'") > 0) + + "_id_seq'", + Long.class) > 0) { - String idColumnName = (String) jdbcTemplate.queryForObject( - "SELECT COLUMN_NAME FROM information_schema.columns WHERE TABLE_NAME ILIKE '" - + tableName - + "' AND COLUMN_DEFAULT ILIKE 'nextval(%" - + tableName - + "_id_seq%'", - String.class); - long tableRows = jdbcTemplate.queryForLong("SELECT MAX(" + idColumnName + ") FROM " + tableName); - long sequenceVal = jdbcTemplate.queryForLong("SELECT last_value FROM " + tableName + "_id_seq"); + String idColumnName = jdbcTemplate + .queryForObject( + "SELECT COLUMN_NAME FROM information_schema.columns WHERE TABLE_NAME ILIKE '" + + tableName + + "' AND COLUMN_DEFAULT ILIKE 'nextval(%" + + tableName + + "_id_seq%'", + String.class); + long tableRows = jdbcTemplate + .queryForObject("SELECT MAX(" + idColumnName + ") FROM " + tableName, Long.class); + long sequenceVal = jdbcTemplate + .queryForObject("SELECT last_value FROM " + tableName + "_id_seq", Long.class); if ((sequenceVal >= 0) && (tableRows > sequenceVal)) { - jdbcTemplate.execute("SELECT setval('" - + tableName - + "_id_seq', " - + Long.toString(tableRows + offset) - + ")"); - log.info("Moved sequence \"{}_id_seq\" value from {} to {}.", new Object[]{ - tableName, - sequenceVal, - (tableRows + offset) }); + jdbcTemplate.execute( + "SELECT setval('" + tableName + "_id_seq', " + Long.toString(tableRows + offset) + ")"); + log.info( + "Moved sequence \"{}_id_seq\" value from {} to {}.", + new Object[]{tableName, sequenceVal, (tableRows + offset) }); jdbcTemplate.execute("REINDEX TABLE " + tableName); log.info("Reindexed table: " + tableName); } Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -29,9 +27,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * Compares the function script with the one stored in the db and drops and recreates it if the scripts differs. Be * aware that tabs chars are ALWAYS considered different, so remove them from your scripts! This works ONLY for SQL @@ -51,11 +51,11 @@ { String checkQuery = "select count(*) from dbo.sysobjects where id = object_id(?) and xtype in (N'FN', N'IF', N'TF')"; - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { String functionName = this.objectNameFromFileName(script); - int result = jdbcTemplate.queryForInt(checkQuery, functionName); + int result = jdbcTemplate.queryForObject(checkQuery, Integer.class, functionName); String scriptContent = readFully(script); scriptContent = StringUtils.replace(scriptContent, "\t", " "); if (StringUtils.isBlank(scriptContent)) @@ -69,10 +69,8 @@ } else { // If the script is too long a list will be returned, and it must be joined to get the original script. - List<String> previousDDlList = jdbcTemplate.getJdbcOperations().queryForList( - "exec sp_helptext ?", - new Object[]{functionName }, - String.class); + List<String> previousDDlList = jdbcTemplate + .queryForList("exec sp_helptext ?", new Object[]{functionName }, String.class); String previousDDl = StringUtils.join(previousDDlList.toArray(new String[previousDDlList.size()])); if (!StringUtils.equals(previousDDl, scriptContent)) { @@ -93,7 +91,7 @@ * @param script Function script. * @return */ - private void createFunction(SimpleJdbcTemplate jdbcTemplate, String script) + private void createFunction(JdbcTemplate jdbcTemplate, String script) { String[] ddls = StringUtils.split(script, ";"); for (String ddl : ddls) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.io.IOException; import java.io.InputStream; @@ -28,9 +26,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * @author fgiust * @version $Id:SqlServerObjCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ @@ -90,7 +90,7 @@ @Override public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { String fqTableName = this.objectNameFromFileName(script); @@ -99,11 +99,12 @@ if (StringUtils.contains(fqTableName, ".")) { String[] tokens = StringUtils.split(fqTableName, "."); - result = jdbcTemplate.queryForInt(qualifiedObjQuery, new Object[]{tokens[1], tokens[0] }); + result = jdbcTemplate + .queryForObject(qualifiedObjQuery, Integer.class, new Object[]{tokens[1], tokens[0] }); } else { - result = jdbcTemplate.queryForInt(unqualifiedObjQuery, fqTableName); + result = jdbcTemplate.queryForObject(unqualifiedObjQuery, Integer.class, fqTableName); } if (result == 0) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -29,9 +27,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * Compares the procedure script with the one stored in the db and drops and recreates it if the scripts differs. Be * aware that tabs chars are ALWAYS considered different, so remove them from your scripts! This works ONLY for SQL @@ -50,11 +50,11 @@ public void execute(DataSource dataSource) { String checkQuery = "select count(*) from dbo.sysobjects where id = object_id(?) and (OBJECTPROPERTY(id, N'IsProcedure') = 1)"; - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { String procedureName = this.objectNameFromFileName(script); - int result = jdbcTemplate.queryForInt(checkQuery, procedureName); + int result = jdbcTemplate.queryForObject(checkQuery, Integer.class, procedureName); String scriptContent = readFully(script); scriptContent = StringUtils.replace(scriptContent, "\t", " "); if (StringUtils.isBlank(scriptContent)) @@ -68,10 +68,8 @@ } else { // If the script is too long a list will be returned, and it must be joined to get the original script. - List<String> previousDDlList = jdbcTemplate.getJdbcOperations().queryForList( - "exec sp_helptext ?", - new Object[]{procedureName }, - String.class); + List<String> previousDDlList = jdbcTemplate + .queryForList("exec sp_helptext ?", new Object[]{procedureName }, String.class); String previousDDl = StringUtils.join(previousDDlList.toArray(new String[previousDDlList.size()])); if (!StringUtils.equals(previousDDl, scriptContent)) { @@ -92,7 +90,7 @@ * @param script Stored procedure script. * @return */ - private void createProcedure(SimpleJdbcTemplate jdbcTemplate, String script) + private void createProcedure(JdbcTemplate jdbcTemplate, String script) { String[] ddls = StringUtils.split(script, ";"); for (String ddl : ddls) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,10 +18,6 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.BaseDbTask; -import it.openutils.migration.task.setup.DbTask; -import it.openutils.migration.task.setup.ScriptBasedUnconditionalTask; - import java.io.IOException; import java.util.List; @@ -32,9 +28,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.BaseDbTask; +import it.openutils.migration.task.setup.DbTask; +import it.openutils.migration.task.setup.ScriptBasedUnconditionalTask; + /** * @author fgiust * @version $Id:SqlServerScriptBasedUnconditionalTask.java 3143 2007-09-24 19:50:49Z fgiust $ @@ -86,7 +86,7 @@ } String[] ddls = splitStatements(scriptContent); - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (final String ddl : ddls) { Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,15 +18,15 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.DbTask; - import java.util.List; import javax.sql.DataSource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.DbTask; + /** * @author Danilo Ghirardelli * @version $Id:SqlServerSynonymCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ @@ -62,22 +62,18 @@ public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (String objectName : objects) { - int result = jdbcTemplate.queryForInt( + int result = jdbcTemplate.queryForObject( "select count(*) from dbo.sysobjects where id = object_id(?) and xtype = N'SN'", + Integer.class, objectName); if (result == 0) { - jdbcTemplate.update("CREATE SYNONYM [dbo].[" - + objectName - + "] FOR [" - + source - + "].[dbo].[" - + objectName - + "]"); + jdbcTemplate.update( + "CREATE SYNONYM [dbo].[" + objectName + "] FOR [" + source + "].[dbo].[" + objectName + "]"); } } Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -18,8 +18,6 @@ package it.openutils.migration.sqlserver; -import it.openutils.migration.task.setup.GenericConditionalTask; - import java.io.IOException; import java.io.InputStream; import java.util.List; @@ -29,9 +27,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; +import it.openutils.migration.task.setup.GenericConditionalTask; + /** * @author Danilo Ghirardelli * @version $Id: SqlServerViewCreateOrUpdateTask.java 391 2007-07-10 17:25:42Z fgiust $ @@ -49,12 +49,12 @@ String checkQuery = "select count(*) from dbo.sysobjects where id = object_id(?) and OBJECTPROPERTY(id, N'IsView') = 1"; - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); for (Resource script : scripts) { String viewName = this.objectNameFromFileName(script); - int result = jdbcTemplate.queryForInt(checkQuery, viewName); + int result = jdbcTemplate.queryForObject(checkQuery, Integer.class, viewName); String scriptContent = readFully(script); scriptContent = StringUtils.replace(scriptContent, "\t", " "); @@ -73,10 +73,8 @@ else { - List<String> previousDDlList = jdbcTemplate.getJdbcOperations().queryForList( - "exec sp_helptext ?", - new Object[]{viewName }, - String.class); + List<String> previousDDlList = jdbcTemplate + .queryForList("exec sp_helptext ?", new Object[]{viewName }, String.class); String previousDDl = StringUtils.join(previousDDlList.toArray(new String[previousDDlList.size()])); @@ -100,7 +98,7 @@ * @param script * @return */ - private void createView(SimpleJdbcTemplate jdbcTemplate, String script) + private void createView(JdbcTemplate jdbcTemplate, String script) { String[] ddls = StringUtils.split(script, ";"); Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -31,7 +31,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.simple.SimpleJdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; /** @@ -125,10 +125,10 @@ /** * Subclasses need to override this method and provide specific checks. - * @param jdbcTemplate SimpleJdbcTemplate + * @param jdbcTemplate JdbcTemplate * @return true if the condition is met */ - public abstract boolean check(SimpleJdbcTemplate jdbcTemplate); + public abstract boolean check(JdbcTemplate jdbcTemplate); /** * {@inheritDoc} @@ -192,7 +192,7 @@ */ public void execute(DataSource dataSource) { - SimpleJdbcTemplate jdbcTemplate = new SimpleJdbcTemplate(dataSource); + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); if (check(jdbcTemplate) ^ not) { @@ -241,7 +241,7 @@ * @param jdbcTemplate * @param scriptContent */ - protected void executeSingle(SimpleJdbcTemplate jdbcTemplate, String scriptContent) + protected void executeSingle(JdbcTemplate jdbcTemplate, String scriptContent) { String[] ddls; if (StringUtils.isNotEmpty(splitChar)) Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2015-04-17 11:06:02 UTC (rev 4635) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2016-04-03 20:06:40 UTC (rev 4636) @@ -141,25 +141,25 @@ InputStream is = null; try { - is = script.getInputStream(); - POIFSFileSystem fs = new POIFSFileSystem(is); - HSSFWorkbook hssfworkbook = new HSSFWorkbook(fs); - int sheetNums = hssfworkbook.getNumberOfSheets(); - for (int j = 0; j < sheetNums; j++) - { - HSSFSheet sheet = hssfworkbook.getSheetAt(j); - String sheetName = StringUtils.trim(hssfworkbook.getSheetName(j)); - QueryConfig conf = config.get(sheetName); - if (conf == null) - { - suggestSheetConfig(sheet, sheetName, conf, dataSource); - continue; - } - - String tableName = (StringUtils.isBlank(conf.getTableName())) ? sheetName : conf.getTableName(); - processSheet(sheet, tableName, conf, dataSource); - } + is = script.getInputStream(); + POIFSFileSystem fs = new POIFSFileSystem(is); + HSSFWorkbook hssfworkbook = new HSSFWorkbook(fs); + int sheetNums = hssfworkbook.getNumberOfSheets(); + for (int j = 0; j < sheetNums; j++) + { + HSSFSheet sheet = hssfworkbook.getSheetAt(j); + String sheetName = StringUtils.trim(hssfworkbook.getSheetName(j)); + QueryConfig conf = config.get(sheetName); + if (conf == null) + { + suggestSheetConfig(sheet, sheetName, conf, dataSource); + continue; + } + String tableName = (StringUtils.isBlank(conf.getTableName())) ? sheetName : conf.getTableName(); + processSheet(sheet, tableName, conf, dataSource); + } + } catch (IOException e) { @@ -210,17 +210,19 @@ buffer.append(" <entry key=\""); buffer.append(tableName); - buffer.append("\">\n" - + " <bean class=\"it.openutils.migration.task.setup.ExcelConfigurationTask$QueryConfig\">\n" - + " <property name=\"checkQuery\">\n" - + " <value>"); + buffer.append( + "\">\n" + + " <bean class=\"it.openutils.migration.task.setup.ExcelConfigurationTask$QueryConfig\">\n" + + " <property name=\"checkQuery\">\n" + + " <value>"); String initialCol = columns.get(0); buffer.append("select count(" + initialCol + ") from " + tableName + " where " + initialCol + " = ?"); - buffer.append("</value>\n" - + " </property>\n" - + " <property name=\"insertQuery\">\n" - + " <value>"); + buffer.append( + "</value>\n" + + " </property>\n" + + " <property name=\"insertQuery\">\n" + + " <value>"); buffer.append("INSERT INTO "); buffer.append(tableName); @@ -429,12 +431,14 @@ int existing; try { - existing = jdbcTemplate.queryForInt(checkStatement, checkParams, checkParamTypes); + existing = jdbcTemplate.queryForObject(checkStatement, Integer.class, checkParams, checkParamTypes); } catch (BadSqlGrammarException bsge) { - log.error("Error executing check query, current sheet will be skipped. {} Query in error: {}", bsge - .getMessage(), checkStatement); + log.error( + "Error executing check query, current sheet will be skipped. {} Query in error: {}", + bsge.getMessage(), + checkStatement); return; } @@ -478,16 +482,17 @@ if (log.isDebugEnabled()) { - log.debug("Missing record with key {}; inserting {}", ArrayUtils.toString(checkParams), ArrayUtils - .toString(insertParams)); + log.debug( + "Missing record with key {}; inserting {}", + ArrayUtils.toString(checkParams), + ArrayUtils.toString(insertParams)); } if (insertParams.length != insertTypes.length) { - log.warn("Invalid number of param/type for table {}. Params: {}, types: {}", new Object[]{ - tableName, - insertParams.length, - insertTypes.length}); + log.warn( + "Invalid number of param/type for table {}. Params: {}, types: {}", + new Object[]{tableName, insertParams.length, insertTypes.length }); } try @@ -496,15 +501,14 @@ } catch (DataIntegrityViolationException bsge) { - log - .error( - "Error executing update, record at {}:{} will be skipped. Query in error: '{}', values: {}. Error message: {}", - new Object[]{ - tableName, - rowNum + 1, - insertStatement, - ArrayUtils.toString(insertParams), - bsge.getMessage()}); + log.error( + "Error executing update, record at {}:{} will be skipped. Query in error: '{}', values:... [truncated message content] |
From: <fg...@us...> - 2016-04-04 13:54:36
|
Revision: 4637 http://openutils.svn.sourceforge.net/openutils/?rev=4637&view=rev Author: fgiust Date: 2016-04-04 13:54:34 +0000 (Mon, 04 Apr 2016) Log Message: ----------- update deps Modified Paths: -------------- trunk/openutils-dbmigration/pom.xml trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/DatabaseConditionalTaskList.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericConditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ScriptBasedUnconditionalTask.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/update/ScriptBasedDbUpdate.java Added Paths: ----------- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerAnonymousUniqueConstraintDelete.java trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerDefaultValueConstraintDelete.java Modified: trunk/openutils-dbmigration/pom.xml =================================================================== --- trunk/openutils-dbmigration/pom.xml 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/pom.xml 2016-04-04 13:54:34 UTC (rev 4637) @@ -34,14 +34,14 @@ </scm> <dependencies> <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.4</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>1.4</version> + <version>2.4</version> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -79,17 +79,17 @@ <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.7.5</version> + <version>1.7.20</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> - <version>1.7.5</version> + <version>1.7.20</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.2-FINAL</version> + <version>3.14</version> <optional>true</optional> <exclusions> <exclusion> @@ -105,8 +105,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> + <version>6.9.10</version> <scope>test</scope> <exclusions> <exclusion> Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/DbSetupManagerImpl.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -25,7 +25,7 @@ import javax.sql.DataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcColumnBasedConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnExistsConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -23,7 +23,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIndexExistsConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -28,10 +28,10 @@ import java.util.Set; import java.util.TreeSet; -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfColumnIsNotNullableConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -20,7 +20,7 @@ import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; /** Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfForeignKeyExistsConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -23,7 +23,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfPrimaryKeyExistsConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -26,7 +26,7 @@ import java.util.Map; import java.util.TreeMap; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcIfTableExistsConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -23,7 +23,7 @@ import java.sql.ResultSet; import java.sql.SQLException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/generic/JdbcObjectCreationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -28,7 +28,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.Resource; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OraclePackageCreationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -26,7 +26,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleSequenceCreationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -23,7 +23,7 @@ import javax.sql.DataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleTriggerTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -18,7 +18,7 @@ package it.openutils.migration.oracle; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.jdbc.core.JdbcTemplate; import it.openutils.migration.task.setup.GenericConditionalTask; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/oracle/OracleViewCreateOrUpdateTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -28,7 +28,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/postgres/PostGreSQLSequenceChecker.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -25,7 +25,7 @@ import javax.sql.DataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.ConnectionCallback; import org.springframework.jdbc.core.JdbcTemplate; Added: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerAnonymousUniqueConstraintDelete.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerAnonymousUniqueConstraintDelete.java (rev 0) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerAnonymousUniqueConstraintDelete.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -0,0 +1,144 @@ +/** + * + * openutils dbmigration (http://www.openmindlab.com/lab/products/dbmigration.html) + * Copyright(C) 2007-2010, Openmind S.r.l. http://www.openmindonline.it + * + * Licensed 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. + */ + +package it.openutils.migration.sqlserver; + +import it.openutils.migration.task.setup.DbTask; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import javax.sql.DataSource; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.core.JdbcTemplate; + + +/** + * This class can be used to remove anonymous unique constraint from sql server db specifying the table name and the + * column name that have the constraint. + * @author gcast + * + */ +public class SqlServerAnonymousUniqueConstraintDelete implements DbTask // NO_UCD (unused code) +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(SqlServerAnonymousUniqueConstraintDelete.class); + + /** + * name of the table with the unique constraint to remove. + */ + private String tableName; + + /** + * name of the column with the unique constraint to remove. + */ + private String columnName; + + /** + * name of the column with the unique constraint to remove. + */ + private String description; + + private static final String QUERY_TO_FIND_NAME_OF_UNIQUE_CONSTRAINT_INDEX = "select indxs.name index_name " + + " from sys.indexes indxs, sys.columns clmns, sys.index_columns indx_clmn " + + " where indxs.object_id = object_id(?) " + + " and clmns.object_id = object_id(?) " + + " and indx_clmn.object_id = object_id(?) " + + " and indxs.index_id = indx_clmn.index_id " + + " and clmns.column_id = indx_clmn.column_id " + + " and indxs.is_unique_constraint = 1 " + + " and clmns.name = ?"; + + /** + * Sets the tableName. + * @param tableName the tableName to set + */ + public void setTableName(String tableName) + { + this.tableName = tableName; + } + + /** + * Sets the columnName. + * @param columnName the columnName to set + */ + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + /** + * {@inheritDoc} + */ + @Override + public void execute(DataSource dataSource) + { + if (StringUtils.isBlank(tableName) || StringUtils.isBlank(columnName)) + { + log.error( + "Both table name and column name must be specificed. table name: \"{}\", column name \"{}\".", + tableName, + columnName); + return; + } + + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); + List<String> query = jdbcTemplate.query(QUERY_TO_FIND_NAME_OF_UNIQUE_CONSTRAINT_INDEX, new RowMapper<String>() + { + + @Override + public String mapRow(ResultSet rs, int rowNum) throws SQLException + { + return rs.getString("index_name"); + } + }, tableName, tableName, tableName, columnName); + if (query.size() == 1) + { + String alterTableDropConstraint = "ALTER TABLE " + tableName + " DROP CONSTRAINT " + query.get(0); + log.debug("Executing:\n{}", alterTableDropConstraint); + jdbcTemplate.update(alterTableDropConstraint); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() + { + return description; + } + + /** + * Sets the description. + * @param description the description to set + */ + public void setDescription(String description) + { + this.description = description; + } + +} Property changes on: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerAnonymousUniqueConstraintDelete.java ___________________________________________________________________ Added: svn \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerDefaultValueConstraintDelete.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerDefaultValueConstraintDelete.java (rev 0) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerDefaultValueConstraintDelete.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -0,0 +1,141 @@ +/** + * + * openutils dbmigration (http://www.openmindlab.com/lab/products/dbmigration.html) + * Copyright(C) 2007-2010, Openmind S.r.l. http://www.openmindonline.it + * + * Licensed 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. + */ + +package it.openutils.migration.sqlserver; + +import it.openutils.migration.task.setup.DbTask; + +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.List; + +import javax.sql.DataSource; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.core.JdbcTemplate; + + +/** + * This class can be used to remove anonymous unique constraint from sql server db specifying the table name and the + * column name that have the constraint. + * @author gcast + * + */ +public class SqlServerDefaultValueConstraintDelete implements DbTask // NO_UCD (unused code) +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(SqlServerDefaultValueConstraintDelete.class); + + /** + * name of the table with the unique constraint to remove. + */ + private String tableName; + + /** + * name of the column with the unique constraint to remove. + */ + private String columnName; + + /** + * name of the column with the unique constraint to remove. + */ + private String description; + + private static final String QUERY_TO_FIND_NAME_OF_UNIQUE_CONSTRAINT_INDEX = "SELECT NAME " + + " FROM SYSOBJECTS SO " + + " JOIN SYSCONSTRAINTS SC ON SO.ID = SC.CONSTID " + + " WHERE OBJECT_NAME(SO.PARENT_OBJ) = ? " + + " AND SO.XTYPE = 'D' AND SC.COLID = " + + " (SELECT COLID FROM SYSCOLUMNS WHERE ID = OBJECT_ID(?) AND NAME = ?)"; + + /** + * Sets the tableName. + * @param tableName the tableName to set + */ + public void setTableName(String tableName) + { + this.tableName = tableName; + } + + /** + * Sets the columnName. + * @param columnName the columnName to set + */ + public void setColumnName(String columnName) + { + this.columnName = columnName; + } + + /** + * {@inheritDoc} + */ + @Override + public void execute(DataSource dataSource) + { + if (StringUtils.isBlank(tableName) || StringUtils.isBlank(columnName)) + { + log.error( + "Both table name and column name must be specificed. table name: \"{}\", column name \"{}\".", + tableName, + columnName); + return; + } + + JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); + List<String> query = jdbcTemplate.query(QUERY_TO_FIND_NAME_OF_UNIQUE_CONSTRAINT_INDEX, new RowMapper<String>() + { + + @Override + public String mapRow(ResultSet rs, int rowNum) throws SQLException + { + return rs.getString("name"); + } + }, tableName, tableName, columnName); + if (query.size() == 1) + { + String alterTableDropConstraint = "ALTER TABLE " + tableName + " DROP CONSTRAINT " + query.get(0); + log.debug("Executing:\n{}", alterTableDropConstraint); + jdbcTemplate.update(alterTableDropConstraint); + } + } + + /** + * {@inheritDoc} + */ + @Override + public String getDescription() + { + return description; + } + + /** + * Sets the description. + * @param description the description to set + */ + public void setDescription(String description) + { + this.description = description; + } + +} Property changes on: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerDefaultValueConstraintDelete.java ___________________________________________________________________ Added: svn \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerFunctionCreateOrUpdateTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -25,7 +25,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerObjCreationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -24,7 +24,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerProcedureCreateOrUpdateTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -25,7 +25,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerScriptBasedUnconditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -24,7 +24,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerSynonymCreationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -17,11 +17,16 @@ */ package it.openutils.migration.sqlserver; + import java.util.List; import javax.sql.DataSource; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.jdbc.core.JdbcTemplate; import it.openutils.migration.task.setup.DbTask; @@ -29,23 +34,14 @@ /** * @author Danilo Ghirardelli - * @version $Id:SqlServerSynonymCreationTask.java 3143 2007-09-24 19:50:49Z fgiust $ + * */ public class SqlServerSynonymCreationTask implements DbTask { - private String source; - private List<String> objects; - /** - * Sets the source. - * @param source the source to set - */ - public void setSource(String source) - { - this.source = source; - } + private Logger log = LoggerFactory.getLogger(SqlServerSynonymCreationTask.class); /** * Sets the objects. @@ -59,6 +55,7 @@ /** * {@inheritDoc} */ + @Override public void execute(DataSource dataSource) { @@ -66,15 +63,40 @@ for (String objectName : objects) { + + String originalobj = objectName; + String synonym = objectName; + + if (StringUtils.contains(objectName, "=")) + { + synonym = StringUtils.substringBefore(originalobj, "="); + originalobj = StringUtils.substringAfter(originalobj, "="); + } + int result = jdbcTemplate.queryForObject( "select count(*) from dbo.sysobjects where id = object_id(?) and xtype = N'SN'", - Integer.class, - objectName); - if (result == 0) + new Object[]{synonym }, + Integer.class); + + if (result > 0) { - jdbcTemplate.update( - "CREATE SYNONYM [dbo].[" + objectName + "] FOR [" + source + "].[dbo].[" + objectName + "]"); + // existing synonym, nothing to do + continue; } + + result = jdbcTemplate.queryForObject( + "select count(*) from dbo.sysobjects where id = object_id(?)", + new Object[]{synonym }, + Integer.class); + + if (result > 0) + { + log.warn("An existing object with name {} has been found, but it's not a synonym as expected", synonym); + continue; + } + + jdbcTemplate.update("CREATE SYNONYM " + synonym + " FOR " + originalobj + ""); + } } @@ -82,8 +104,9 @@ /** * {@inheritDoc} */ + @Override public String getDescription() { - return "Creating synonyms from " + source; + return "Creating synonyms from " + ArrayUtils.toString(objects); } } \ No newline at end of file Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/sqlserver/SqlServerViewCreateOrUpdateTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -1,6 +1,6 @@ /** * - * openutils db migration (http://www.openmindlab.com/lab/products/dbmigration.html) + * openutils dbmigration (http://www.openmindlab.com/lab/products/dbmigration.html) * Copyright(C) 2007-2010, Openmind S.r.l. http://www.openmindonline.it * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -25,7 +25,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.Resource; import org.springframework.jdbc.core.JdbcTemplate; @@ -54,7 +54,7 @@ { String viewName = this.objectNameFromFileName(script); - int result = jdbcTemplate.queryForObject(checkQuery, Integer.class, viewName); + int result = jdbcTemplate.queryForObject(checkQuery, new Object[]{viewName }, Integer.class); String scriptContent = readFully(script); scriptContent = StringUtils.replace(scriptContent, "\t", " "); @@ -73,17 +73,23 @@ else { - List<String> previousDDlList = jdbcTemplate - .queryForList("exec sp_helptext ?", new Object[]{viewName }, String.class); + List<String> previousDDlList = jdbcTemplate.queryForList( + "exec sp_helptext ?", + new Object[]{viewName }, + String.class); String previousDDl = StringUtils.join(previousDDlList.toArray(new String[previousDDlList.size()])); - if (!StringUtils.equals(previousDDl, scriptContent)) + if (!StringUtils.equals( + StringUtils.replace(previousDDl, " ", ""), + StringUtils.replace(scriptContent, " ", ""))) { log.info( "Previous definition of view {} differs from actual. Dropping and recreating view", new Object[]{viewName }); + // log.warn("=====\n{}\n=====", previousDDl); + jdbcTemplate.update("DROP VIEW [dbo].[" + viewName + "]"); createView(jdbcTemplate, scriptContent); Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/BaseConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -27,11 +27,12 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; -import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.jdbc.core.JdbcTemplate; + /** Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/DatabaseConditionalTaskList.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/DatabaseConditionalTaskList.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/DatabaseConditionalTaskList.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -24,7 +24,7 @@ import javax.sql.DataSource; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ExcelConfigurationTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -34,9 +34,9 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.ObjectUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericConditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericConditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/GenericConditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -20,7 +20,7 @@ import java.util.HashMap; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.jdbc.core.JdbcTemplate; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ScriptBasedUnconditionalTask.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ScriptBasedUnconditionalTask.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/setup/ScriptBasedUnconditionalTask.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -24,7 +24,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; Modified: trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/update/ScriptBasedDbUpdate.java =================================================================== --- trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/update/ScriptBasedDbUpdate.java 2016-04-03 20:06:40 UTC (rev 4636) +++ trunk/openutils-dbmigration/src/main/java/it/openutils/migration/task/update/ScriptBasedDbUpdate.java 2016-04-04 13:54:34 UTC (rev 4637) @@ -24,7 +24,7 @@ import javax.sql.DataSource; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.Resource; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |