cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439588 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/access/types/ main/java/org/apache/cayenne/dba/ test/java/org/apache/art/ test/java/org/apache/art/auto/ test/java/org/apache/cayenne/ test/jav...
Date Sat, 02 Sep 2006 13:02:39 GMT
Author: aadamchik
Date: Sat Sep  2 06:02:38 2006
New Revision: 439588

URL: http://svn.apache.org/viewvc?rev=439588&view=rev
Log:
CAY-648 - refactoring ExtendedTypeMap to use ExtendedTypeFactories for all non-standard types
such as enums and serializables 

Added:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/EnumTypeFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/SerializableTypeFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/SerializableEntity.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_SerializableEntity.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/MockSerializable.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/dba/TypesMapping.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/dba/TypesMappingTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/resources/testmap.map.xml

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/EnumTypeFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/EnumTypeFactory.java?rev=439588&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/EnumTypeFactory.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/EnumTypeFactory.java
Sat Sep  2 06:02:38 2006
@@ -0,0 +1,69 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.access.types;
+
+import java.lang.reflect.Constructor;
+
+import org.apache.cayenne.util.Util;
+
+/**
+ * ExtendedTypeFactory for handling JDK 1.5 Enums. Gracefully handles JDK 1.4 environment.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+class EnumTypeFactory implements ExtendedTypeFactory {
+
+    private Constructor enumTypeConstructor;
+
+    EnumTypeFactory() {
+
+        // see if we can support enums
+        try {
+            Class enumTypeClass = Util
+                    .getJavaClass("org.apache.cayenne.access.types.EnumType");
+            enumTypeConstructor = enumTypeClass.getConstructor(new Class[] {
+                Class.class
+            });
+        }
+        catch (Throwable th) {
+            // no enums support... either Java 1.4 or Cayenne 1.5 extensions are absent
+        }
+    }
+
+    public ExtendedType getType(Class objectClass) {
+        if (enumTypeConstructor == null) {
+            return null;
+        }
+
+        try {
+            // load EnumType via reflection as the source has to stay JDK 1.4 compliant
+            ExtendedType type = (ExtendedType) enumTypeConstructor
+                    .newInstance(new Object[] {
+                        objectClass
+                    });
+
+            return type;
+        }
+        catch (Throwable th) {
+            // ignore exceptions...
+            return null;
+        }
+    }
+}

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java?rev=439588&r1=439587&r2=439588&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeMap.java
Sat Sep  2 06:02:38 2006
@@ -19,7 +19,6 @@
 
 package org.apache.cayenne.access.types;
 
-import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -42,27 +41,19 @@
     protected Map typeMap = new HashMap();
     protected DefaultType defaultType = new DefaultType();
 
-    Constructor enumTypeConstructor;
     Collection extendedTypeFactories;
 
+    // standard type factories registered by Cayenne that are consulted after the user
+    // factories.
+    Collection internalTypeFactories;
+
     /**
      * Creates new ExtendedTypeMap, populating it with default JDBC-compatible types. If
      * JDK version is at least 1.5, also loads support for enumerated types.
      */
     public ExtendedTypeMap() {
-        // see if we can support enums
-        try {
-            Class enumTypeClass = Util
-                    .getJavaClass("org.apache.cayenne.access.types.EnumType");
-            this.enumTypeConstructor = enumTypeClass.getConstructor(new Class[] {
-                Class.class
-            });
-        }
-        catch (Throwable th) {
-            // no enums support... either Java 1.4 or Cayenne 1.5 extensions are absent
-        }
-
-        this.initDefaultTypes();
+        initDefaultTypes();
+        initDefaultFactories();
     }
 
     /**
@@ -80,6 +71,21 @@
     }
 
     /**
+     * Registers default factories for creating enum types and serializable types. Note
+     * that user-defined factories are consulted before any default factory.
+     * 
+     * @since 3.0
+     */
+    protected void initDefaultFactories() {
+        internalTypeFactories = new ArrayList(2);
+        internalTypeFactories.add(new EnumTypeFactory());
+
+        // note that Serializable type should be used as a last resort after all other
+        // alternatives are exhausted.
+        internalTypeFactories.add(new SerializableTypeFactory());
+    }
+
+    /**
      * Returns ExtendedTypeFactories registered with this instance.
      * 
      * @since 1.2
@@ -149,9 +155,13 @@
      * <li>First the methods checks for an ExtendedType explicitly registered with
the
      * map for a given class name (most common types are registered by Cayenne internally;
      * users can regsiter their own).</li>
-     * <li>Second, the method tries to obtain a type by iterating through registered
-     * {@link ExtendedTypeFactory} instances. If a factory returns a non-null type, it is
-     * returned to the user and the rest of the factories are ignored. </li>
+     * <li>Second, the method tries to obtain a type by iterating through
+     * {@link ExtendedTypeFactory} instances registered by users. If a factory returns a
+     * non-null type, it is returned to the user and the rest of the factories are
+     * ignored. </li>
+     * <li>Third, the method iterates through standard {@link ExtendedTypeFactory}
+     * instances that can dynamically construct extended types for serializable objects
+     * and JDK 1.5 enums.</li>
      * <li>If all the methods above failed, the default type is returned that relies
on
      * default JDBC driver mapping to set and get objects.</li>
      * </ul>
@@ -219,6 +229,14 @@
     }
 
     /**
+     * @deprecated since 3.0 - use {@link #createType(String)} instead.
+     * @since 1.2
+     */
+    protected ExtendedType getDefaultType(String javaClassName) {
+        return createType(javaClassName);
+    }
+
+    /**
      * Returns a default type for specific Java classes. This implementation supports
      * dynamically loading EnumType handlers for concrete Enum classes (assuming the
      * application runs under JDK1.5+).
@@ -227,63 +245,47 @@
      *         mapping.
      * @since 1.2
      */
-    protected ExtendedType getDefaultType(String javaClassName) {
+    protected ExtendedType createType(String className) {
 
-        if (javaClassName == null) {
+        if (className == null) {
             return null;
         }
 
-        // check what else that could possibly be...
-        ExtendedType type;
-
         Class typeClass;
-
         try {
-            typeClass = Util.getJavaClass(javaClassName);
+            typeClass = Util.getJavaClass(className);
         }
         catch (Throwable th) {
             // ignore exceptions...
             return null;
         }
 
+        // lookup in user factories first
         if (extendedTypeFactories != null) {
 
             Iterator it = extendedTypeFactories.iterator();
             while (it.hasNext()) {
                 ExtendedTypeFactory factory = (ExtendedTypeFactory) it.next();
 
-                type = factory.getType(typeClass);
+                ExtendedType type = factory.getType(typeClass);
                 if (type != null) {
                     return type;
                 }
             }
         }
 
-        // TODO: Andrus, 10/30/2005 - make Enums use a factory just like everything else
-        return checkEnumType(typeClass);
-    }
-
-    /**
-     * @since 1.2
-     */
-    ExtendedType checkEnumType(Class typeClass) {
-        if (enumTypeConstructor == null) {
-            return null;
-        }
-
-        try {
+        // lookup in internal factories
 
-            // load EnumType via reflection as the source has to stay 1.4 compliant
-            ExtendedType type = (ExtendedType) enumTypeConstructor
-                    .newInstance(new Object[] {
-                        typeClass
-                    });
+        Iterator it = internalTypeFactories.iterator();
+        while (it.hasNext()) {
+            ExtendedTypeFactory factory = (ExtendedTypeFactory) it.next();
 
-            return type;
-        }
-        catch (Throwable th) {
-            // ignore exceptions...
-            return null;
+            ExtendedType type = factory.getType(typeClass);
+            if (type != null) {
+                return type;
+            }
         }
+
+        return null;
     }
 }

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/SerializableTypeFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/SerializableTypeFactory.java?rev=439588&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/SerializableTypeFactory.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/SerializableTypeFactory.java
Sat Sep  2 06:02:38 2006
@@ -0,0 +1,32 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.access.types;
+
+/**
+ * ExtendedTypeFactory for handling serializable objects.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+class SerializableTypeFactory implements ExtendedTypeFactory {
+
+    public ExtendedType getType(Class objectClass) {
+        return null;
+    }
+}

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/dba/TypesMapping.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/dba/TypesMapping.java?rev=439588&r1=439587&r2=439588&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/dba/TypesMapping.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/dba/TypesMapping.java
Sat Sep  2 06:02:38 2006
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.dba;
 
+import java.io.Serializable;
 import java.math.BigInteger;
 import java.sql.DatabaseMetaData;
 import java.sql.ResultSet;
@@ -349,12 +350,28 @@
     /**
      * Returns default java.sql.Types type by the Java type name.
      * 
-     * @param javaTypeName Fully qualified Java Class name.
+     * @param className Fully qualified Java Class name.
      * @return The SQL type or NOT_DEFINED if no type found.
      */
-    public static int getSqlTypeByJava(String javaTypeName) {
-        Integer temp = (Integer) javaSqlEnum.get(javaTypeName);
-        return (null == temp) ? NOT_DEFINED : temp.intValue();
+    public static int getSqlTypeByJava(String className) {
+        Integer type = (Integer) javaSqlEnum.get(className);
+        if (type != null) {
+            return type.intValue();
+        }
+
+        // try to load a Java class - some nonstandard mappings may work
+        Class aClass;
+        try {
+            aClass = Class.forName(className, true, Thread
+                    .currentThread()
+                    .getContextClassLoader());
+        }
+        catch (Throwable th) {
+            return NOT_DEFINED;
+        }
+        
+
+        return getSqlTypeByJava(aClass);
     }
 
     /**
@@ -363,27 +380,21 @@
      * @since 1.1
      */
     public static int getSqlTypeByJava(Class javaClass) {
-        if(javaClass == null) {
+        if (javaClass == null) {
             return NOT_DEFINED;
         }
-        
-        // check non-standard types
-        if(Calendar.class.isAssignableFrom(javaClass)) {
-            return Types.TIMESTAMP;
-        }
-        else if(BigInteger.class.isAssignableFrom(javaClass)) {
-            return Types.BIGINT;
-        }
-        
-        while (javaClass != null) {
+
+        // check standard mapping of class and superclasses
+        Class aClass = javaClass;
+        while (aClass != null) {
 
             String name;
 
-            if (javaClass.isArray()) {
-                name = javaClass.getComponentType().getName() + "[]";
+            if (aClass.isArray()) {
+                name = aClass.getComponentType().getName() + "[]";
             }
             else {
-                name = javaClass.getName();
+                name = aClass.getName();
             }
 
             Object type = javaSqlEnum.get(name);
@@ -391,7 +402,20 @@
                 return ((Number) type).intValue();
             }
 
-            javaClass = javaClass.getSuperclass();
+            aClass = aClass.getSuperclass();
+        }
+
+        // check non-standard JDBC types that are still supported by JPA
+        if (Calendar.class.isAssignableFrom(javaClass)) {
+            return Types.TIMESTAMP;
+        }
+        else if (BigInteger.class.isAssignableFrom(javaClass)) {
+            return Types.BIGINT;
+        }
+        // serializable check should be the last one when all other mapping attempts
+        // failed
+        else if (Serializable.class.isAssignableFrom(javaClass)) {
+            return Types.BLOB;
         }
 
         return NOT_DEFINED;

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/SerializableEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/SerializableEntity.java?rev=439588&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/SerializableEntity.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/SerializableEntity.java
Sat Sep  2 06:02:38 2006
@@ -0,0 +1,10 @@
+package org.apache.art;
+
+import org.apache.art.auto._SerializableEntity;
+
+public class SerializableEntity extends _SerializableEntity {
+
+}
+
+
+

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_SerializableEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_SerializableEntity.java?rev=439588&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_SerializableEntity.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_SerializableEntity.java
Sat Sep  2 06:02:38 2006
@@ -0,0 +1,22 @@
+package org.apache.art.auto;
+
+/** Class _SerializableEntity was generated by Cayenne.
+  * It is probably a good idea to avoid changing this class manually, 
+  * since it may be overwritten next time code is regenerated. 
+  * If you need to make any customizations, please use subclass. 
+  */
+public class _SerializableEntity extends org.apache.cayenne.CayenneDataObject {
+
+    public static final String SERIALIZABLE_FIELD_PROPERTY = "serializableField";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setSerializableField(org.apache.cayenne.MockSerializable serializableField)
{
+        writeProperty("serializableField", serializableField);
+    }
+    public org.apache.cayenne.MockSerializable getSerializableField() {
+        return (org.apache.cayenne.MockSerializable)readProperty("serializableField");
+    }
+    
+    
+}

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/MockSerializable.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/MockSerializable.java?rev=439588&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/MockSerializable.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/MockSerializable.java
Sat Sep  2 06:02:38 2006
@@ -0,0 +1,42 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne;
+
+import java.io.Serializable;
+
+public class MockSerializable implements Serializable {
+
+    protected String name;
+
+    public MockSerializable() {
+
+    }
+
+    public MockSerializable(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/dba/TypesMappingTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/dba/TypesMappingTst.java?rev=439588&r1=439587&r2=439588&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/dba/TypesMappingTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/dba/TypesMappingTst.java
Sat Sep  2 06:02:38 2006
@@ -30,6 +30,7 @@
 import java.util.List;
 
 import org.apache.cayenne.unit.CayenneTestCase;
+import org.apache.cayenne.MockSerializable;
 
 public class TypesMappingTst extends CayenneTestCase {
 
@@ -42,6 +43,21 @@
         assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(Calendar.class));
         assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(GregorianCalendar.class));
         assertEquals(Types.BIGINT, TypesMapping.getSqlTypeByJava(BigInteger.class));
+        
+        assertEquals(Types.BLOB, TypesMapping.getSqlTypeByJava(MockSerializable.class));
+    }
+    
+    public void testGetSqlTypeByJavaString() throws Exception {
+        assertEquals(Types.VARCHAR, TypesMapping.getSqlTypeByJava(String.class.getName()));
+
+        // make sure we can handle arrays...
+        assertEquals(Types.BINARY, TypesMapping.getSqlTypeByJava("byte[]"));
+        
+        assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(Calendar.class.getName()));
+        assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(GregorianCalendar.class.getName()));
+        assertEquals(Types.BIGINT, TypesMapping.getSqlTypeByJava(BigInteger.class.getName()));
+        
+        assertEquals(Types.BLOB, TypesMapping.getSqlTypeByJava(MockSerializable.class.getName()));
     }
     
     public void testGetSqlTypeByJavaPrimitive() throws Exception {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/resources/testmap.map.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/resources/testmap.map.xml?rev=439588&r1=439587&r2=439588&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/resources/testmap.map.xml (original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/resources/testmap.map.xml Sat
Sep  2 06:02:38 2006
@@ -175,6 +175,10 @@
 		<db-attribute name="PAINTING_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="TEXT_REVIEW" type="LONGVARCHAR"/>
 	</db-entity>
+	<db-entity name="SERIALIZABLE_ENTITY">
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+		<db-attribute name="SERIALIZABLE_FIELD" type="BLOB"/>
+	</db-entity>
 	<db-entity name="SMALLINT_TEST">
 		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="SMALLINT_COL" type="SMALLINT"/>
@@ -343,6 +347,9 @@
 		<obj-attribute name="estimatedPrice" type="java.math.BigDecimal" db-attribute-path="ESTIMATED_PRICE"/>
 		<obj-attribute name="paintingTitle" type="java.lang.String" db-attribute-path="PAINTING_TITLE"/>
 		<obj-attribute name="textReview" type="java.lang.String" db-attribute-path="toPaintingInfo.TEXT_REVIEW"/>
+	</obj-entity>
+	<obj-entity name="SerializableEntity" className="org.apache.art.SerializableEntity" dbEntityName="SERIALIZABLE_ENTITY">
+		<obj-attribute name="serializableField" type="org.apache.cayenne.MockSerializable" db-attribute-path="SERIALIZABLE_FIELD"/>
 	</obj-entity>
 	<obj-entity name="SmallintTestEntity" className="org.apache.art.SmallintTestEntity" dbEntityName="SMALLINT_TEST">
 		<obj-attribute name="smallintCol" type="java.lang.Short" db-attribute-path="SMALLINT_COL"/>



Mime
View raw message