cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r603169 - /cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java
Date Tue, 11 Dec 2007 08:01:56 GMT
Author: aadamchik
Date: Tue Dec 11 00:01:38 2007
New Revision: 603169

URL: http://svn.apache.org/viewvc?rev=603169&view=rev
Log:
relationship dialog incorrectly displayed "list" for to-one relationship semantics

Modified:
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java?rev=603169&r1=603168&r2=603169&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjRelationshipTableModel.java
Tue Dec 11 00:01:38 2007
@@ -132,16 +132,18 @@
                 semantics += ", read-only";
             }
 
-            String collection = "list";
-            if (relationship.getCollectionType() != null) {
-                int dot = relationship.getCollectionType().lastIndexOf('.');
-                collection = relationship
-                        .getCollectionType()
-                        .substring(dot + 1)
-                        .toLowerCase();
-            }
+            if (relationship.isToMany()) {
+                String collection = "list";
+                if (relationship.getCollectionType() != null) {
+                    int dot = relationship.getCollectionType().lastIndexOf('.');
+                    collection = relationship
+                            .getCollectionType()
+                            .substring(dot + 1)
+                            .toLowerCase();
+                }
 
-            semantics += ", " + collection;
+                semantics += ", " + collection;
+            }
 
             return semantics;
         }



Mime
View raw message