openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From allee8...@apache.org
Subject svn commit: r633921 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ openjpa-kernel/src/main/java/org/apa...
Date Wed, 05 Mar 2008 16:38:49 GMT
Author: allee8285
Date: Wed Mar  5 08:38:46 2008
New Revision: 633921

URL: http://svn.apache.org/viewvc?rev=633921&view=rev
Log:
After OPENJPA-9, -help option in scripts is not working anymore. This is caused by Configurations.runAgainstAllAnchors
returns true if no error is encountered (including no operation) during function execution.
Since the check of the -help option is in the command's run method and if no anchor is found,
the help check is skipped.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/TableSchemaFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.java
Wed Mar  5 08:38:46 2008
@@ -189,9 +189,6 @@
      */
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts) throws Exception {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         String action = opts.removeProperty("action", "a", null);
         Configurations.populateConfiguration(conf, opts);
         return run(conf, args, action, null, null);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
Wed Mar  5 08:38:46 2008
@@ -337,9 +337,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws Exception {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         String action = opts.removeProperty("action", "a", null);
         Configurations.populateConfiguration(conf, opts);
         return run(conf, args, action);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
Wed Mar  5 08:38:46 2008
@@ -635,9 +635,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws Exception {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         String action = opts.removeProperty("action", "a", null);
         Configurations.populateConfiguration(conf, opts);
         return run(conf, args, action);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.java
Wed Mar  5 08:38:46 2008
@@ -142,9 +142,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws Exception {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         String action = opts.removeProperty("action", "a", null);
         Configurations.populateConfiguration(conf, opts);
         return run(conf, args, action, null, null);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Wed Mar  5 08:38:46 2008
@@ -942,9 +942,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws IOException, SQLException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         // flags
         Flags flags = new Flags();
         flags.action = opts.removeProperty("action", "a", flags.action);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
Wed Mar  5 08:38:46 2008
@@ -1843,9 +1843,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws IOException, SQLException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         // flags
         Flags flags = new Flags();
         flags.packageName = opts.removeProperty

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaTool.java
Wed Mar  5 08:38:46 2008
@@ -1357,9 +1357,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws IOException, SQLException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         Flags flags = new Flags();
         flags.dropTables = opts.removeBooleanProperty
             ("dropTables", "dt", flags.dropTables);

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/TableSchemaFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/TableSchemaFactory.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/TableSchemaFactory.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/TableSchemaFactory.java
Wed Mar  5 08:38:46 2008
@@ -473,9 +473,6 @@
     public static boolean run(JDBCConfiguration conf, String[] args,
         Options opts)
         throws IOException, SQLException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         String action = opts.removeProperty("action", "a", null);
         Configurations.populateConfiguration(conf, opts);
         return run(conf, action);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/ApplicationIdTool.java
Wed Mar  5 08:38:46 2008
@@ -1306,9 +1306,6 @@
     public static boolean run(OpenJPAConfiguration conf, String[] args,
         Options opts)
         throws IOException, ClassNotFoundException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         Flags flags = new Flags();
         flags.ignoreErrors = opts.removeBooleanProperty
             ("ignoreErrors", "i", flags.ignoreErrors);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java
Wed Mar  5 08:38:46 2008
@@ -4365,9 +4365,6 @@
     public static boolean run(OpenJPAConfiguration conf, String[] args,
         Options opts)
         throws IOException {
-        if (opts.containsKey("help") || opts.containsKey("-help"))
-            return false;
-
         Flags flags = new Flags();
         flags.directory = Files.getFile(opts.removeProperty("directory", "d",
             null), null);

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java (original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/MetaDataTool.java Wed
Mar  5 08:38:46 2008
@@ -251,7 +251,8 @@
         throws IOException {
         Options opts = new Options();
         final String[] arguments = opts.setFromCmdLine(args);
-        boolean ret = Configurations.runAgainstAllAnchors(opts,
+        boolean ret = (args.length > 0) &&
+            Configurations.runAgainstAllAnchors(opts,
             new Configurations.Runnable() {
             public boolean run(Options opts) throws Exception {
                 OpenJPAConfiguration conf = new OpenJPAConfigurationImpl();
@@ -272,10 +273,6 @@
     public static boolean run(OpenJPAConfiguration conf, String[] args,
         Options opts)
         throws IOException {
-        if (args.length == 0 || opts.containsKey("help")
-            || opts.containsKey("-help"))
-            return false;
-
         Flags flags = new Flags();
         flags.action = opts.removeProperty("action", "a", flags.action);
         String fileName = opts.removeProperty("file", "f", null);

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java?rev=633921&r1=633920&r2=633921&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/conf/Configurations.java
Wed Mar  5 08:38:46 2008
@@ -673,6 +673,9 @@
      */
     public static boolean runAgainstAllAnchors(Options opts,
         Configurations.Runnable runnable) {
+        if (opts.containsKey("help") || opts.containsKey("-help")) {
+            return false;
+        }
         List anchors =
             Configurations.getFullyQualifiedAnchorsInPropertiesLocation(opts);
 



Mime
View raw message