cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertdzeig...@apache.org
Subject svn commit: r755128 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
Date Tue, 17 Mar 2009 06:14:55 GMT
Author: robertdzeigler
Date: Tue Mar 17 06:14:55 2009
New Revision: 755128

URL: http://svn.apache.org/viewvc?rev=755128&view=rev
Log:
CAY-1196: CayenneRuntimeException in modeler due to ClassNotFoundException when java type
is invalid and db attribute is null.

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=755128&r1=755127&r2=755128&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Tue Mar 17 06:14:55 2009
@@ -45,7 +45,7 @@
 CAY-1176 missing classes in ROP cayenne-client render nested contexts unusable
 CAY-1180 Model marked as dirty when leaving DataMap name field
 CAY-1183 commitToParent() makes object persistence state committed, produces exception when
using object in parent context (ROP)
-
+CAY-1196 CayenneRuntimeException in modeler due to ClassNotFoundException when java type
is invalid and db attribute is null
 ----------------------------------
 Release: 3.0M5
 Date: 15 Dec 2008

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java?rev=755128&r1=755127&r2=755128&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjAttributeTableModel.java
Tue Mar 17 06:14:55 2009
@@ -35,6 +35,7 @@
 import org.apache.cayenne.modeler.util.CayenneTableModel;
 import org.apache.cayenne.modeler.util.ProjectUtil;
 import org.apache.cayenne.util.Util;
+import org.apache.cayenne.CayenneRuntimeException;
 
 /**
  * Model for the Object Entity attributes and for Obj to DB Attribute Mapping tables.
@@ -171,7 +172,13 @@
                 int type;
                 if (dbAttribute == null) {
                     if (!(attribute instanceof EmbeddedAttribute)) {
-                        type = TypesMapping.getSqlTypeByJava(getAttribute(row).getJavaClass());
+                        try {
+                            type = TypesMapping.getSqlTypeByJava(getAttribute(row).getJavaClass());
+                            //have to catch the exception here to make sure that exceptional
situations
+                            //(class doesn't exist, for example) don't prevent the gui from
properly updating.
+                        } catch (CayenneRuntimeException cre) {
+                            return null;
+                        }
                     } else {
                         return null;
                     }
@@ -234,10 +241,7 @@
     public boolean isCellEditable(int row, int col) {
 
         if (getAttribute(row).isInherited()) {
-            if (col == DB_ATTRIBUTE) {
-                return true;
-            }
-            return false;
+            return col == DB_ATTRIBUTE;
         }
 
         return col != DB_ATTRIBUTE_TYPE && col != INHERITED;



Mime
View raw message