cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r595832 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache: art/PrimitivesTestEntity.java art/auto/_PrimitivesTestEntity.java cayenne/access/PrimitiveAttributesTest.java
Date Fri, 16 Nov 2007 21:25:59 GMT
Author: aadamchik
Date: Fri Nov 16 13:25:58 2007
New Revision: 595832

URL: http://svn.apache.org/viewvc?rev=595832&view=rev
Log:
CAY-903 Support primitive types in DataObjects

Added:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_PrimitivesTestEntity.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/PrimitivesTestEntity.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/PrimitivesTestEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/PrimitivesTestEntity.java?rev=595832&r1=595831&r2=595832&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/PrimitivesTestEntity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/PrimitivesTestEntity.java
Fri Nov 16 13:25:58 2007
@@ -18,9 +18,8 @@
  ****************************************************************/
 package org.apache.art;
 
-import org.apache.cayenne.CayenneDataObject;
+import org.apache.art.auto._PrimitivesTestEntity;
 
-// TODO: andrus, 10/25/2007 a placeholder until CAY-904 is fixed and CAY-903 can be fully
tested
-public class PrimitivesTestEntity extends CayenneDataObject {
+public class PrimitivesTestEntity extends _PrimitivesTestEntity {
 
-}
+}
\ No newline at end of file

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_PrimitivesTestEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_PrimitivesTestEntity.java?rev=595832&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_PrimitivesTestEntity.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/art/auto/_PrimitivesTestEntity.java
Fri Nov 16 13:25:58 2007
@@ -0,0 +1,33 @@
+package org.apache.art.auto;
+
+/** Class _PrimitivesTestEntity 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 abstract class _PrimitivesTestEntity extends org.apache.cayenne.CayenneDataObject
{
+
+    public static final String BOOLEAN_COLUMN_PROPERTY = "booleanColumn";
+    public static final String INT_COLUMN_PROPERTY = "intColumn";
+
+    public static final String ID_PK_COLUMN = "ID";
+
+    public void setBooleanColumn(boolean booleanColumn) {
+        writeProperty("booleanColumn", booleanColumn);
+    }
+	public boolean isBooleanColumn() {
+        Boolean value = (Boolean)readProperty("booleanColumn");
+        return (value != null) ? value.booleanValue() : false;
+    }
+
+
+    public void setIntColumn(int intColumn) {
+        writeProperty("intColumn", intColumn);
+    }
+    public int getIntColumn() {
+        Object value = readProperty("intColumn");
+        return (value != null) ? (Integer) value : 0; 
+    }
+
+
+}

Added: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java?rev=595832&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
(added)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/PrimitiveAttributesTest.java
Fri Nov 16 13:25:58 2007
@@ -0,0 +1,36 @@
+/*****************************************************************
+ *   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;
+
+import org.apache.art.PrimitivesTestEntity;
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.unit.CayenneCase;
+
+public class PrimitiveAttributesTest extends CayenneCase {
+
+    public void testCommit() {
+        ObjectContext context = createDataContext();
+
+        PrimitivesTestEntity e = (PrimitivesTestEntity) context
+                .newObject(PrimitivesTestEntity.class);
+        e.setBooleanColumn(true);
+        e.setIntColumn(88);
+        context.commitChanges();
+    }
+}



Mime
View raw message