cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1309909 - /cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java
Date Thu, 05 Apr 2012 15:52:32 GMT
Author: aadamchik
Date: Thu Apr  5 15:52:32 2012
New Revision: 1309909

URL: http://svn.apache.org/viewvc?rev=1309909&view=rev
Log:
CAY-1692 CayenneModeler - trimmed list of available Java data types

patch by Andrei Veprev
(not recording in release notes, as the bug appeared in M4 and preumably nobody has seen it)

Modified:
    cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java

Modified: cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java?rev=1309909&r1=1309908&r2=1309909&view=diff
==============================================================================
--- cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java
(original)
+++ cayenne/main/trunk/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/ModelerUtil.java
Thu Apr  5 15:52:32 2012
@@ -23,21 +23,26 @@ import java.awt.Dimension;
 import java.awt.Point;
 import java.awt.Window;
 import java.io.Serializable;
+import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.URL;
+import java.sql.Date;
+import java.sql.Time;
+import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Collection;
+import java.util.GregorianCalendar;
 import java.util.HashSet;
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Set;
+import java.util.UUID;
 
 import javax.swing.Action;
 import javax.swing.ImageIcon;
 
-import org.apache.cayenne.access.types.ExtendedTypeMap;
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.DataNodeDescriptor;
 import org.apache.cayenne.map.DataMap;
@@ -107,26 +112,37 @@ public final class ModelerUtil {
     }
 
     public static String[] getRegisteredTypeNames() {
-        String[] explicitList = new ExtendedTypeMap().getRegisteredTypeNames();
-        Set<String> nonPrimitives = new HashSet<String>(Arrays.asList(explicitList));
+        Set<String> nonPrimitives = new HashSet<String>();
 
-        // add types that are not mapped explicitly, but nevertheless supported by Cayenne
-        nonPrimitives.add(Calendar.class.getName());
+        nonPrimitives.add(String.class.getName());
+        nonPrimitives.add(BigDecimal.class.getName());
         nonPrimitives.add(BigInteger.class.getName());
-        nonPrimitives.add(Serializable.class.getName());
+        nonPrimitives.add(Boolean.class.getName());
+        nonPrimitives.add(Byte.class.getName());
         nonPrimitives.add(Character.class.getName());
-        nonPrimitives.add("char[]");
+        nonPrimitives.add(Date.class.getName());
+        nonPrimitives.add(java.util.Date.class.getName());
+        nonPrimitives.add(Double.class.getName());
+        nonPrimitives.add(Float.class.getName());
+        nonPrimitives.add(Integer.class.getName());
+        nonPrimitives.add(Long.class.getName());
+        nonPrimitives.add(Short.class.getName());
+        nonPrimitives.add(Time.class.getName());
+        nonPrimitives.add(Timestamp.class.getName());
+        nonPrimitives.add(Date.class.getName());
+        nonPrimitives.add(GregorianCalendar.class.getName());
+        nonPrimitives.add(Calendar.class.getName());
+        nonPrimitives.add(UUID.class.getName());
+        nonPrimitives.add(Serializable.class.getName());
         nonPrimitives.add("java.lang.Character[]");
         nonPrimitives.add("java.lang.Byte[]");
-        nonPrimitives.add("java.util.Date");
-        nonPrimitives.remove(Void.TYPE.getName());
 
         String[] nonPrimitivesNames = new String[nonPrimitives.size()];
         nonPrimitives.toArray(nonPrimitivesNames);
         Arrays.sort(nonPrimitivesNames);
 
         String[] primitivesNames = {
-                "boolean", "byte", "char", "double", "float", "int", "long", "short"
+                "boolean", "byte", "byte[]", "char", "char[]", "double", "float", "int",
"long", "short"
         };
 
         String[] finalList = new String[primitivesNames.length



Mime
View raw message