You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2010/06/29 09:55:26 UTC

svn commit: r958859 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/

Author: aadamchik
Date: Tue Jun 29 07:55:26 2010
New Revision: 958859

URL: http://svn.apache.org/viewvc?rev=958859&view=rev
Log:
CAY-1455 "NULL" JDBC type is shown for DbAttribute data types in the Modeler

* patch by Rostislav Kravchenko + some refactoring

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/TypesMapping.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.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=958859&r1=958858&r2=958859&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 Jun 29 07:55:26 2010
@@ -67,6 +67,7 @@ CAY-1380 Support for Escaped LIKE Clause
 CAY-1402 Ability to use Terminating "@size" in Nested Properties Against Collections
 CAY-1416 ExpressionFactory.noMatchExp.toEJBQL() produces incorrect output
 CAY-1417 EJBQL doesn't support null numeric parameters 
+CAY-1455 "NULL" JDBC type is shown for DbAttribute data types in the Modeler
 
 ----------------------------------
 Release: 3.0 (final) 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/TypesMapping.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/TypesMapping.java?rev=958859&r1=958858&r2=958859&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/TypesMapping.java (original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/TypesMapping.java Tue Jun 29 07:55:26 2010
@@ -27,6 +27,7 @@ import java.sql.SQLException;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.Calendar;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -259,9 +260,12 @@ public class TypesMapping {
                 || type == Types.NUMERIC;
     }
 
-    /** Returns an array of string names of the default JDBC data types. */
+    /** 
+     * Returns an array of string names of the default JDBC data types. 
+     */
     public static String[] getDatabaseTypes() {
-        return sqlStringType.keySet().toArray(new String[0]);
+        Collection<String> types = sqlStringType.keySet();
+        return types.toArray(new String[types.size()]);
     }
 
     /**
@@ -449,7 +453,7 @@ public class TypesMapping {
      * etc.
      * 
      * @return Fully qualified Java type name or null if not found.
-     * @deprecated use getJavaBySqlType(int type) instead. No usable since "0" can means
+     * @deprecated use getJavaBySqlType(int) instead. Not usable since "0" can mean
      *             "undefined", not really zero.
      */
     @Deprecated

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java?rev=958859&r1=958858&r2=958859&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeTab.java Tue Jun 29 07:55:26 2010
@@ -141,7 +141,7 @@ public class DbEntityAttributeTab extend
 
         DbAttributeTableModel model = (DbAttributeTableModel) table.getModel();
         
-        List listAttrs = model.getObjectList();
+        List<?> listAttrs = model.getObjectList();
         int[] newSel = new int[attrs.length];
         
         for (int i = 0; i < attrs.length; i++) {
@@ -223,6 +223,9 @@ public class DbEntityAttributeTab extend
         String[] types = TypesMapping.getDatabaseTypes();
         JComboBox comboBox = CayenneWidgetFactory.createComboBox(types, true);
         
+        // Types.NULL makes no sense as a column type
+        comboBox.removeItem("NULL");
+        
         AutoCompletion.enable(comboBox);
         
         col.setCellEditor(CayenneWidgetFactory.createCellEditor(comboBox));