cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: CAY-2435 cdbimport: procedure parameters are not imported
Date Wed, 23 May 2018 09:22:16 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 26dc6a268 -> 6ea7f3958


CAY-2435 cdbimport: procedure parameters are not imported


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/6ea7f395
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/6ea7f395
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/6ea7f395

Branch: refs/heads/master
Commit: 6ea7f3958119c2d5f5a3bdfd3a863335705def4f
Parents: 26dc6a2
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Wed May 23 12:19:39 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Wed May 23 12:21:54 2018 +0300

----------------------------------------------------------------------
 RELEASE-NOTES.txt                                       |  1 +
 .../dbsync/reverse/dbload/ProcedureColumnLoader.java    | 12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/6ea7f395/RELEASE-NOTES.txt
----------------------------------------------------------------------
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index 2923e0b..27fe24d 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -59,6 +59,7 @@ CAY-2425 Modeler: Migrate DB Direction field is locked if no option was
selected
 CAY-2427 Modeler: Undo throws exception
 CAY-2429 Generate classes: Invalid template type: EMBEDDABLE_SINGLE_CLASS
 CAY-2430 Modeler: Redo throws NPE
+CAY-2435 cdbimport: procedure parameters are not imported
 CAY-2436 NPE in CayenneRuntimeException constructor
 
 ----------------------------------

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6ea7f395/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbload/ProcedureColumnLoader.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbload/ProcedureColumnLoader.java
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbload/ProcedureColumnLoader.java
index 23ba96c..31c6a73 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbload/ProcedureColumnLoader.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/reverse/dbload/ProcedureColumnLoader.java
@@ -59,7 +59,8 @@ public class ProcedureColumnLoader extends PerCatalogAndSchemaLoader {
         String name = rs.getString("PROCEDURE_NAME");
         String key = Procedure.generateFullyQualifiedName(procCatalog, procSchema, name);
         Procedure procedure = map.getProcedure(name);
-        if (procedure == null) {
+        // should be filtered out in getResultSet() method, but check full name here too..
+        if (procedure == null || !key.equals(procedure.getFullyQualifiedName())) {
             return;
         }
 
@@ -80,7 +81,7 @@ public class ProcedureColumnLoader extends PerCatalogAndSchemaLoader {
             return null;
         }
 
-        if (columnName == null) {
+        if (columnName == null || columnName.isEmpty()) {
             if (type == DatabaseMetaData.procedureColumnReturn) {
                 LOGGER.debug("null column name, assuming result column: " + key);
                 columnName = "_return_value";
@@ -103,7 +104,10 @@ public class ProcedureColumnLoader extends PerCatalogAndSchemaLoader
{
         }
 
         ProcedureParameter column = new ProcedureParameter(columnName);
-        column.setDirection(getDirection(type));
+        int direction = getDirection(type);
+        if(direction != -1) {
+            column.setDirection(direction);
+        }
         column.setType(columnType);
         column.setMaxLength(rs.getInt("LENGTH"));
         column.setPrecision(decimalDigits);
@@ -120,6 +124,8 @@ public class ProcedureColumnLoader extends PerCatalogAndSchemaLoader {
                 return ProcedureParameter.IN_OUT_PARAMETER;
             case DatabaseMetaData.procedureColumnOut:
                 return ProcedureParameter.OUT_PARAMETER;
+            case DatabaseMetaData.procedureColumnReturn:
+                return ProcedureParameter.OUT_PARAMETER;
             default:
                 return -1;
         }


Mime
View raw message