cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r470199 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer: MockPojo2Enhanced.java MockPojo3Enhanced.java
Date Thu, 02 Nov 2006 02:43:20 GMT
Author: aadamchik
Date: Wed Nov  1 18:43:19 2006
New Revision: 470199

URL: http://svn.apache.org/viewvc?view=rev&rev=470199
Log:
CAY-682: Generic Cayenne POJO enhancer
(sample enhanced classes)

Added:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo3Enhanced.java
Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo2Enhanced.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo2Enhanced.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo2Enhanced.java?view=diff&rev=470199&r1=470198&r2=470199
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo2Enhanced.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo2Enhanced.java
Wed Nov  1 18:43:19 2006
@@ -66,6 +66,10 @@
     }
 
     public void setToOne(MockPojo3 toOne) {
+        if ($cay_objectContext != null) {
+            $cay_objectContext.propertyChanged(this, "toOne", this.toOne, toOne);
+        }
+
         this.toOne = toOne;
     }
 }

Added: incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo3Enhanced.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo3Enhanced.java?view=auto&rev=470199
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo3Enhanced.java
(added)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.5/src/test/java/org/apache/cayenne/enhancer/MockPojo3Enhanced.java
Wed Nov  1 18:43:19 2006
@@ -0,0 +1,71 @@
+/*****************************************************************
+ *   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.enhancer;
+
+import java.util.List;
+
+import org.apache.cayenne.ObjectContext;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.PersistenceState;
+import org.apache.cayenne.Persistent;
+
+public class MockPojo3Enhanced implements Persistent {
+
+    protected ObjectId $cay_objectId;
+    protected int $cay_persistenceState = PersistenceState.TRANSIENT;
+    protected transient ObjectContext $cay_objectContext;
+
+    protected List<MockPojo2> toMany;
+
+    public int getPersistenceState() {
+        return $cay_persistenceState;
+    }
+
+    public void setPersistenceState(int persistenceState) {
+        this.$cay_persistenceState = persistenceState;
+    }
+
+    public ObjectContext getObjectContext() {
+        return $cay_objectContext;
+    }
+
+    public void setObjectContext(ObjectContext objectContext) {
+        this.$cay_objectContext = objectContext;
+    }
+
+    public ObjectId getObjectId() {
+        return $cay_objectId;
+    }
+
+    public void setObjectId(ObjectId objectId) {
+        this.$cay_objectId = objectId;
+    }
+
+    public List<MockPojo2> getToMany() {
+        if ($cay_objectContext != null) {
+            $cay_objectContext.prepareForAccess(this, "toMany", true);
+        }
+        
+        return toMany;
+    }
+
+    public void setToMany(List<MockPojo2> toMany) {
+        this.toMany = toMany;
+    }
+}



Mime
View raw message