openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Feinberg (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-371) columnDefinition spuriously applied to column name in several contexts
Date Fri, 14 Sep 2007 17:52:32 GMT
columnDefinition spuriously applied to column name in several contexts
----------------------------------------------------------------------

                 Key: OPENJPA-371
                 URL: https://issues.apache.org/jira/browse/OPENJPA-371
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.0.0
            Reporter: Jonathan Feinberg


For example, @JoinColumn(name = "file_id", referencedColumnName = "id", columnDefinition =
"char(32)") results in sql emitted "(char(32) VARCHAR(255)" instead of expected "(file_id
char(32)". Patch enclosed:

--- openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
     (revision 575761)
+++ openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
     (working copy)
@@ -423,7 +423,7 @@
         if (!StringUtils.isEmpty(join.name()))
             col.setName(join.name());
         if (!StringUtils.isEmpty(join.columnDefinition()))
-            col.setName(join.columnDefinition());
+            col.setTypeName(join.columnDefinition());
         if (!StringUtils.isEmpty(join.referencedColumnName()))
             col.setTarget(join.referencedColumnName());
         return col;
@@ -1183,7 +1183,7 @@
         if (!StringUtils.isEmpty(join.name()))
             col.setName(join.name());
         if (!StringUtils.isEmpty(join.columnDefinition()))
-            col.setName(join.columnDefinition());
+            col.setTypeName(join.columnDefinition());
         if (!StringUtils.isEmpty(join.referencedColumnName()))
             col.setTarget(join.referencedColumnName());
         col.setNotNull(!join.nullable());
@@ -1236,7 +1236,7 @@
         if (!StringUtils.isEmpty(join.name()))
             col.setName(join.name());
         if (!StringUtils.isEmpty(join.columnDefinition()))
-            col.setName(join.columnDefinition());
+            col.setTypeName(join.columnDefinition());
         if (!StringUtils.isEmpty(join.referencedColumnName()))
             col.setTarget(join.referencedColumnName());
         if (!StringUtils.isEmpty(join.referencedAttributeName()))
@@ -1342,7 +1342,7 @@
         if (!StringUtils.isEmpty(join.name()))
             col.setName(join.name());
         if (!StringUtils.isEmpty(join.columnDefinition()))
-            col.setName(join.columnDefinition());
+            col.setTypeName(join.columnDefinition());
         if (!StringUtils.isEmpty(join.referencedColumnName()))
             col.setTarget(join.referencedColumnName());
         if (!StringUtils.isEmpty(join.referencedAttributeName()))

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message