cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r439609 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src: main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/access/types/ main/java/org/apache/cayenne/dba/ test/java/org/apache/art/ test/java/org/apache/art/auto/ t...
Date Sat, 02 Sep 2006 15:40:48 GMT
Author: aadamchik
Date: Sat Sep  2 08:40:47 2006
New Revision: 439609

URL: http://svn.apache.org/viewvc?rev=439609&view=rev
Log:
CAY-650

Added:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ByteOrCharArrayFactory.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeDecorator.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/ArraysEntity.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_ArraysEntity.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/QueryLogger.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/access/MiscTypesTst.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

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/QueryLogger.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/QueryLogger.java?rev=439609&r1=439608&r2=439609&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/QueryLogger.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/QueryLogger.java
Sat Sep  2 08:40:47 2006
@@ -109,7 +109,9 @@
             buffer.append(object.getClass().getName()).append('(').append(
                     new java.sql.Timestamp(time)).append(')');
         }
-
+        else if (object instanceof Character) {
+            buffer.append(((Character) object).charValue());
+        }
         else if (object instanceof Boolean) {
             buffer.append('\'').append(object).append('\'');
         }

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ByteOrCharArrayFactory.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ByteOrCharArrayFactory.java?rev=439609&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ByteOrCharArrayFactory.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ByteOrCharArrayFactory.java
Sat Sep  2 08:40:47 2006
@@ -0,0 +1,177 @@
+/*****************************************************************
+ *   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;
+
+/**
+ * A factory that dynamically creates ExtendedTypes for Character[], Byte[] and char[]
+ * based on adapter configured types for String and byte[].
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+class ByteOrCharArrayFactory implements ExtendedTypeFactory {
+
+    private ExtendedTypeMap map;
+
+    ByteOrCharArrayFactory(ExtendedTypeMap map) {
+        this.map = map;
+    }
+
+    public ExtendedType getType(Class objectClass) {
+
+        if (objectClass.isArray()) {
+
+            Class elementType = objectClass.getComponentType();
+
+            if (Character.class.isAssignableFrom(elementType)) {
+                // note - can't use "getRegisteredType" as it causes infinite recursion
+                ExtendedType stringType = map
+                        .getExplictlyRegisteredType("java.lang.String");
+
+                // not sure if this type of recursion can occur, still worth checking
+                if (stringType instanceof CharacterArrayType) {
+                    throw new IllegalStateException(
+                            "Can't create CharacterArrayType for "
+                                    + objectClass.getName()
+                                    + ": no ExtendedType exists for String");
+                }
+
+                return new CharacterArrayType(stringType);
+            }
+            else if (Character.TYPE.isAssignableFrom(elementType)) {
+
+                // note - can't use "getRegisteredType" as it causes infinite recursion
+                ExtendedType stringType = map
+                        .getExplictlyRegisteredType("java.lang.String");
+
+                // not sure if this type of recursion can occur, still worth checking
+                if (stringType instanceof CharArrayType) {
+                    throw new IllegalStateException("Can't create CharArrayType for "
+                            + objectClass.getName()
+                            + ": no ExtendedType exists for String");
+                }
+
+                return new CharArrayType(stringType);
+            }
+            else if (Byte.class.isAssignableFrom(elementType)) {
+                return map.getRegisteredType(byte[].class);
+            }
+        }
+
+        return null;
+    }
+
+    final class CharArrayType extends ExtendedTypeDecorator {
+
+        CharArrayType(ExtendedType stringType) {
+            super(stringType);
+        }
+
+        public String getClassName() {
+            return "char[]";
+        }
+
+        Object fromJavaObject(Object object) {
+            return object != null ? new String((char[]) object) : null;
+        }
+
+        Object toJavaObject(Object object) {
+            return object != null ? ((String) object).toCharArray() : null;
+        }
+    }
+
+    final class CharacterArrayType extends ExtendedTypeDecorator {
+
+        CharacterArrayType(ExtendedType stringType) {
+            super(stringType);
+        }
+
+        public String getClassName() {
+            return "java.lang.Character[]";
+        }
+
+        Object fromJavaObject(Object object) {
+            if (object == null) {
+                return null;
+            }
+
+            Character[] chars = (Character[]) object;
+            StringBuffer buffer = new StringBuffer(chars.length);
+            for (int i = 0; i < chars.length; i++) {
+                buffer.append(chars[i] != null ? chars[i].charValue() : 0);
+            }
+
+            return buffer.toString();
+        }
+
+        Object toJavaObject(Object object) {
+            if (object == null) {
+                return null;
+            }
+
+            String string = object.toString();
+            Character[] chars = new Character[string.length()];
+            for (int i = 0; i < string.length(); i++) {
+                chars[i] = new Character(string.charAt(i));
+            }
+
+            return chars;
+        }
+    }
+
+    final class ByteWrapperArrayType extends ExtendedTypeDecorator {
+
+        ByteWrapperArrayType(ExtendedType byteArrayType) {
+            super(byteArrayType);
+        }
+
+        public String getClassName() {
+            return "java.lang.Byte[]";
+        }
+
+        Object fromJavaObject(Object object) {
+            if (object == null) {
+                return null;
+            }
+
+            Byte[] bytes = (Byte[]) object;
+            byte[] buffer = new byte[bytes.length];
+            for (int i = 0; i < bytes.length; i++) {
+                buffer[i] = bytes[i] != null ? bytes[i].byteValue() : 0;
+            }
+
+            return buffer.toString();
+        }
+
+        Object toJavaObject(Object object) {
+            if (object == null) {
+                return null;
+            }
+
+            byte[] bytes = (byte[]) object;
+            Byte[] byteWrappers = new Byte[bytes.length];
+
+            for (int i = 0; i < bytes.length; i++) {
+                byteWrappers[i] = new Byte(bytes[i]);
+            }
+
+            return byteWrappers;
+        }
+    }
+}

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeDecorator.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeDecorator.java?rev=439609&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeDecorator.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/main/java/org/apache/cayenne/access/types/ExtendedTypeDecorator.java
Sat Sep  2 08:40:47 2006
@@ -0,0 +1,80 @@
+/*****************************************************************
+ *   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.sql.CallableStatement;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import org.apache.cayenne.map.DbAttribute;
+import org.apache.cayenne.validation.ValidationResult;
+
+/**
+ * Decorates another ExtendedType, converting objects to other Java types.
+ * 
+ * @since 3.0
+ * @author Andrus Adamchik
+ */
+abstract class ExtendedTypeDecorator implements ExtendedType {
+
+    private ExtendedType decorated;
+
+    ExtendedTypeDecorator(ExtendedType decorated) {
+        this.decorated = decorated;
+    }
+
+    abstract Object toJavaObject(Object object);
+
+    abstract Object fromJavaObject(Object object);
+
+    public abstract String getClassName();
+
+    public Object materializeObject(CallableStatement rs, int index, int type)
+            throws Exception {
+        return toJavaObject(decorated.materializeObject(rs, index, type));
+    }
+
+    public Object materializeObject(ResultSet rs, int index, int type) throws Exception {
+        return toJavaObject(decorated.materializeObject(rs, index, type));
+    }
+
+    public void setJdbcObject(
+            PreparedStatement statement,
+            Object value,
+            int pos,
+            int type,
+            int precision) throws Exception {
+        decorated.setJdbcObject(statement, fromJavaObject(value), pos, type, precision);
+    }
+
+    public boolean validateProperty(
+            Object source,
+            String property,
+            Object value,
+            DbAttribute dbAttribute,
+            ValidationResult validationResult) {
+        
+        return decorated.validateProperty(
+                source,
+                property,
+                value,
+                dbAttribute,
+                validationResult);
+    }
+}

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=439609&r1=439608&r2=439609&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 08:40:47 2006
@@ -33,6 +33,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.cayenne.util.Util;
+
 /**
  * A utility class that handles mappings of JDBC data types to the database types and Java
  * types. Also contains methods that provide information about JDBC types.
@@ -354,22 +356,24 @@
      * @return The SQL type or NOT_DEFINED if no type found.
      */
     public static int getSqlTypeByJava(String className) {
+        if (className == null) {
+            return NOT_DEFINED;
+        }
+
         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());
+            aClass = Util.getJavaClass(className);
         }
         catch (Throwable th) {
             return NOT_DEFINED;
         }
-        
 
         return getSqlTypeByJava(aClass);
     }
@@ -406,6 +410,19 @@
         }
 
         // check non-standard JDBC types that are still supported by JPA
+        if (javaClass.isArray()) {
+
+            Class elementType = javaClass.getComponentType();
+            if (Character.class.isAssignableFrom(elementType)
+                    || Character.TYPE.isAssignableFrom(elementType)) {
+                return Types.VARCHAR;
+            }
+            else if (Byte.class.isAssignableFrom(elementType)
+                    || Byte.TYPE.isAssignableFrom(elementType)) {
+                return Types.VARBINARY;
+            }
+        }
+        
         if (Calendar.class.isAssignableFrom(javaClass)) {
             return Types.TIMESTAMP;
         }
@@ -415,7 +432,7 @@
         // serializable check should be the last one when all other mapping attempts
         // failed
         else if (Serializable.class.isAssignableFrom(javaClass)) {
-            return Types.BLOB;
+            return Types.VARBINARY;
         }
 
         return NOT_DEFINED;

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

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_ArraysEntity.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_ArraysEntity.java?rev=439609&view=auto
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_ArraysEntity.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/art/auto/_ArraysEntity.java
Sat Sep  2 08:40:47 2006
@@ -0,0 +1,49 @@
+package org.apache.art.auto;
+
+/** Class _ArraysEntity 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 _ArraysEntity extends org.apache.cayenne.CayenneDataObject {
+
+    public static final String BYTE_ARRAY_PROPERTY = "byteArray";
+    public static final String BYTE_WRAPPER_ARRAY_PROPERTY = "byteWrapperArray";
+    public static final String CHAR_ARRAY_PROPERTY = "charArray";
+    public static final String CHAR_WRAPPER_ARRAY_PROPERTY = "charWrapperArray";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setByteArray(byte[] byteArray) {
+        writeProperty("byteArray", byteArray);
+    }
+    public byte[] getByteArray() {
+        return (byte[])readProperty("byteArray");
+    }
+    
+    
+    public void setByteWrapperArray(Byte[] byteWrapperArray) {
+        writeProperty("byteWrapperArray", byteWrapperArray);
+    }
+    public Byte[] getByteWrapperArray() {
+        return (Byte[])readProperty("byteWrapperArray");
+    }
+    
+    
+    public void setCharArray(char[] charArray) {
+        writeProperty("charArray", charArray);
+    }
+    public char[] getCharArray() {
+        return (char[])readProperty("charArray");
+    }
+    
+    
+    public void setCharWrapperArray(Character[] charWrapperArray) {
+        writeProperty("charWrapperArray", charWrapperArray);
+    }
+    public Character[] getCharWrapperArray() {
+        return (Character[])readProperty("charWrapperArray");
+    }
+    
+    
+}

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/MiscTypesTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/MiscTypesTst.java?rev=439609&r1=439608&r2=439609&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/MiscTypesTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4/src/test/java/org/apache/cayenne/access/MiscTypesTst.java
Sat Sep  2 08:40:47 2006
@@ -18,6 +18,9 @@
  ****************************************************************/
 package org.apache.cayenne.access;
 
+import java.lang.reflect.Array;
+
+import org.apache.art.ArraysEntity;
 import org.apache.art.SerializableEntity;
 import org.apache.cayenne.MockSerializable;
 import org.apache.cayenne.query.SelectQuery;
@@ -48,5 +51,65 @@
 
         test.setSerializableField(null);
         context.commitChanges();
+    }
+
+    public void testCharArray() {
+        DataContext context = createDataContext();
+
+        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+
+        char[] a = new char[] {
+                'x', 'y', 'z'
+        };
+        test.setCharArray(a);
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(ArraysEntity.class);
+        ArraysEntity testRead = (ArraysEntity) context.performQuery(q).get(0);
+        assertNotNull(testRead.getCharArray());
+        assertArraysEqual(a, testRead.getCharArray());
+
+        test.setCharArray(null);
+        context.commitChanges();
+    }
+
+    public void testCharacterArray() {
+        DataContext context = createDataContext();
+
+        ArraysEntity test = (ArraysEntity) context.newObject(ArraysEntity.class);
+
+        Character[] a = new Character[] {
+                new Character('x'), new Character('y'), new Character('z')
+        };
+        test.setCharWrapperArray(a);
+        context.commitChanges();
+
+        SelectQuery q = new SelectQuery(ArraysEntity.class);
+        ArraysEntity testRead = (ArraysEntity) context.performQuery(q).get(0);
+        assertNotNull(testRead.getCharWrapperArray());
+        assertArraysEqual(a, testRead.getCharWrapperArray());
+
+        test.setCharWrapperArray(null);
+        context.commitChanges();
+    }
+
+    void assertArraysEqual(Object a1, Object a2) {
+
+        if (a1 == null && a2 == null) {
+            return;
+        }
+
+        if (a1 == null && a2 != null) {
+            fail("First array is null");
+        }
+
+        if (a2 == null && a1 != null) {
+            fail("Second array is null");
+        }
+
+        assertEquals(Array.getLength(a1), Array.getLength(a2));
+        for (int i = 0; i < Array.getLength(a1); i++) {
+            assertEquals("Difference at index " + i, Array.get(a1, i), Array.get(a2, i));
+        }
     }
 }

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=439609&r1=439608&r2=439609&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 08:40:47 2006
@@ -29,8 +29,8 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.cayenne.unit.CayenneTestCase;
 import org.apache.cayenne.MockSerializable;
+import org.apache.cayenne.unit.CayenneTestCase;
 
 public class TypesMappingTst extends CayenneTestCase {
 
@@ -44,7 +44,10 @@
         assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(GregorianCalendar.class));
         assertEquals(Types.BIGINT, TypesMapping.getSqlTypeByJava(BigInteger.class));
         
-        assertEquals(Types.BLOB, TypesMapping.getSqlTypeByJava(MockSerializable.class));
+        assertEquals(Types.VARBINARY, TypesMapping.getSqlTypeByJava(MockSerializable.class));
+        assertEquals(Types.VARCHAR, TypesMapping.getSqlTypeByJava(char[].class));
+        assertEquals(Types.VARCHAR, TypesMapping.getSqlTypeByJava(Character[].class));
+        assertEquals(Types.VARBINARY, TypesMapping.getSqlTypeByJava(Byte[].class));
     }
     
     public void testGetSqlTypeByJavaString() throws Exception {
@@ -57,7 +60,11 @@
         assertEquals(Types.TIMESTAMP, TypesMapping.getSqlTypeByJava(GregorianCalendar.class.getName()));
         assertEquals(Types.BIGINT, TypesMapping.getSqlTypeByJava(BigInteger.class.getName()));
         
-        assertEquals(Types.BLOB, TypesMapping.getSqlTypeByJava(MockSerializable.class.getName()));
+        assertEquals(Types.VARBINARY, TypesMapping.getSqlTypeByJava(MockSerializable.class.getName()));
+        
+        assertEquals(Types.VARCHAR, TypesMapping.getSqlTypeByJava("char[]"));
+        assertEquals(Types.VARCHAR, TypesMapping.getSqlTypeByJava("java.lang.Character[]"));
+        assertEquals(Types.VARBINARY, TypesMapping.getSqlTypeByJava("java.lang.Byte[]"));
     }
     
     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=439609&r1=439608&r2=439609&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 08:40:47 2006
@@ -12,6 +12,13 @@
 	<procedure name="cayenne_tst_upd_proc">
 		<procedure-parameter name="paintingPrice" type="INTEGER" direction="in"/>
 	</procedure>
+	<db-entity name="ARRAYS_ENTITY">
+		<db-attribute name="BYTE_ARRAY" type="VARBINARY" length="200"/>
+		<db-attribute name="BYTE_WRAPPER_ARRAY" type="VARBINARY" length="200"/>
+		<db-attribute name="CHAR_ARRAY" type="VARCHAR" length="200"/>
+		<db-attribute name="CHAR_WRAPPER_ARRAY" type="VARCHAR" length="200"/>
+		<db-attribute name="ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
+	</db-entity>
 	<db-entity name="ARTGROUP">
 		<db-attribute name="GROUP_ID" type="INTEGER" isPrimaryKey="true" isMandatory="true"/>
 		<db-attribute name="NAME" type="VARCHAR" isMandatory="true" length="100"/>
@@ -198,6 +205,12 @@
 			<db-attribute-ref name="PAINTING_ID"/>
 		</db-attribute-derived>
 	</db-entity>
+	<obj-entity name="ArraysEntity" className="org.apache.art.ArraysEntity" dbEntityName="ARRAYS_ENTITY">
+		<obj-attribute name="byteArray" type="byte[]" db-attribute-path="BYTE_ARRAY"/>
+		<obj-attribute name="byteWrapperArray" type="java.lang.Byte[]" db-attribute-path="BYTE_WRAPPER_ARRAY"/>
+		<obj-attribute name="charArray" type="char[]" db-attribute-path="CHAR_ARRAY"/>
+		<obj-attribute name="charWrapperArray" type="java.lang.Character[]" db-attribute-path="CHAR_WRAPPER_ARRAY"/>
+	</obj-entity>
 	<obj-entity name="ArtGroup" className="org.apache.art.ArtGroup" dbEntityName="ARTGROUP">
 		<obj-attribute name="name" type="java.lang.String" db-attribute-path="NAME"/>
 	</obj-entity>



Mime
View raw message