This is an automated email from the ASF dual-hosted git repository.

ntimofeev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git

commit 1bc3ae2281d17a5a323b596e507ba6fb2fd71fe5
Author: Nikita Timofeev <stari...@gmail.com>
AuthorDate: Wed Nov 4 14:44:51 2020 +0300

    Ignore type reported by metadata and use only type name, as some drivers or 
DBs (e.g. mysql 5.x) could report here incorrect type.
---
 .../cayenne/dbsync/merge/context/EntityMergeSupport.java       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
index 93c9a25..46be314 100644
--- 
a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
+++ 
b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/context/EntityMergeSupport.java
@@ -298,12 +298,12 @@ public class EntityMergeSupport {
         }
 
         // Check additional common DB types, like 'json' or 'geometry'
-        if(dbAttribute.getType() == Types.OTHER) {
-            if(dbAttribute instanceof DetectedDbAttribute) {
-                DetectedDbAttribute detectedDbAttribute = 
(DetectedDbAttribute)dbAttribute;
-                String jdbcTypeName = detectedDbAttribute.getJdbcTypeName();
+        if(dbAttribute instanceof DetectedDbAttribute) {
+            DetectedDbAttribute detectedDbAttribute = 
(DetectedDbAttribute)dbAttribute;
+            String jdbcTypeName = detectedDbAttribute.getJdbcTypeName();
+            if(jdbcTypeName != null) {
                 String type = 
SQL_ADDITIONAL_TYPES_TO_JAVA_TYPE.get(jdbcTypeName.toLowerCase());
-                if(type != null) {
+                if (type != null) {
                     return type;
                 }
             }

Reply via email to