cleanup Protostuff module

Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/0c26497d
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/0c26497d
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/0c26497d

Branch: refs/heads/master
Commit: 0c26497d120ad13dc5bef81f0653621dc85b675b
Parents: 7783be1
Author: Savva Kolbachev <s.kolbac...@gmail.com>
Authored: Mon May 2 17:23:21 2016 +0300
Committer: Savva Kolbachev <s.kolbac...@gmail.com>
Committed: Mon May 23 17:23:08 2016 +0300

----------------------------------------------------------------------
 cayenne-protostuff/pom.xml                      |  17 +-
 .../rop/client/ProtostuffClientModule.java      |  32 --
 .../rop/client/ProtostuffModule.java            |  44 +++
 .../ProtostuffROPSerializationService.java      |   7 +-
 .../ProtostuffROPSerializationServiceIT.java    |   4 +-
 .../protostuff/persistent/ClientMtTable1.java   |  20 +-
 .../protostuff/persistent/ClientMtTable2.java   |  20 +-
 .../rop/protostuff/persistent/MtTable1.java     |  14 +-
 .../rop/protostuff/persistent/MtTable2.java     |  14 +-
 .../persistent/auto/_ClientMtTable1.java        | 382 +++++++++----------
 .../persistent/auto/_ClientMtTable2.java        | 126 +++---
 .../protostuff/persistent/auto/_MtTable1.java   | 154 ++++----
 .../protostuff/persistent/auto/_MtTable2.java   |  68 ++--
 .../cayenne/rop/ROPSerializationService.java    |   5 +
 14 files changed, 462 insertions(+), 445 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/pom.xml
----------------------------------------------------------------------
diff --git a/cayenne-protostuff/pom.xml b/cayenne-protostuff/pom.xml
index a26baab..76af8a4 100644
--- a/cayenne-protostuff/pom.xml
+++ b/cayenne-protostuff/pom.xml
@@ -38,11 +38,6 @@
             </dependency>
             <dependency>
                 <groupId>io.protostuff</groupId>
-                <artifactId>protostuff-api</artifactId>
-                <version>${protostuff.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>io.protostuff</groupId>
                 <artifactId>protostuff-collectionschema</artifactId>
                 <version>${protostuff.version}</version>
             </dependency>
@@ -52,7 +47,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.cayenne</groupId>
-            <artifactId>cayenne-client</artifactId>
+            <artifactId>cayenne-server</artifactId>
             <version>${project.version}</version>
         </dependency>
 
@@ -66,14 +61,16 @@
         </dependency>
         <dependency>
             <groupId>io.protostuff</groupId>
-            <artifactId>protostuff-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.protostuff</groupId>
             <artifactId>protostuff-collectionschema</artifactId>
         </dependency>
 
         <dependency>
+            <groupId>org.apache.cayenne</groupId>
+            <artifactId>cayenne-client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <scope>test</scope>

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffClientModule.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffClientModule.java
 
b/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffClientModule.java
deleted file mode 100644
index 80b81f5..0000000
--- 
a/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffClientModule.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*****************************************************************
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.configuration.rop.client;
-
-import org.apache.cayenne.di.Binder;
-import org.apache.cayenne.di.Module;
-import org.apache.cayenne.rop.ROPSerializationService;
-import 
org.apache.cayenne.rop.protostuff.ProtostuffROPSerializationServiceProvider;
-
-public class ProtostuffClientModule implements Module {
-
-    @Override
-    public void configure(Binder binder) {
-        
binder.bind(ROPSerializationService.class).toProvider(ProtostuffROPSerializationServiceProvider.class);
-    }
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffModule.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffModule.java
 
b/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffModule.java
new file mode 100644
index 0000000..b4a89e5
--- /dev/null
+++ 
b/cayenne-protostuff/src/main/java/org/apache/cayenne/configuration/rop/client/ProtostuffModule.java
@@ -0,0 +1,44 @@
+/*****************************************************************
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.configuration.rop.client;
+
+import org.apache.cayenne.di.Binder;
+import org.apache.cayenne.di.Module;
+import org.apache.cayenne.rop.ROPSerializationService;
+import 
org.apache.cayenne.rop.protostuff.ProtostuffROPSerializationServiceProvider;
+
+/**
+ * A DI module that uses Protostuff Object Graph Serialization as Cayenne 
{@link ROPSerializationService}.
+ * <a href="http://www.protostuff.io/";>
+ *
+ * Note the you usually have to add 
-Dprotostuff.runtime.collection_schema_on_repeated_fields=true as VM option
+ * because Cayenne objects might have cyclic collection fields.
+ *
+ * @since 4.0
+ */
+public class ProtostuffModule implements Module {
+
+    public ProtostuffModule() {
+    }
+
+    @Override
+    public void configure(Binder binder) {
+        
binder.bind(ROPSerializationService.class).toProvider(ProtostuffROPSerializationServiceProvider.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/main/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationService.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/main/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationService.java
 
b/cayenne-protostuff/src/main/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationService.java
index 599b9c0..39cdbc9 100644
--- 
a/cayenne-protostuff/src/main/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationService.java
+++ 
b/cayenne-protostuff/src/main/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationService.java
@@ -28,6 +28,10 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+/**
+ * This {@link ROPSerializationService} implementation uses Protostuff {@link 
GraphIOUtil} to (de)serialize
+ * Cayenne object graph.
+ */
 public class ProtostuffROPSerializationService implements 
ROPSerializationService {
 
     @Override
@@ -57,11 +61,10 @@ public class ProtostuffROPSerializationService implements 
ROPSerializationServic
         Wrapper result = schema.newMessage();
         GraphIOUtil.mergeFrom(serializedObject, result, schema);
         return objectClass.cast(result.data);
-
     }
 
     private class Wrapper {
-        public Object data;
+        private Object data;
 
         public Wrapper(Object data) {
             this.data = data;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationServiceIT.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationServiceIT.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationServiceIT.java
index d2c73bb..b077056 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationServiceIT.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/ProtostuffROPSerializationServiceIT.java
@@ -21,7 +21,7 @@ package org.apache.cayenne.rop.protostuff;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.configuration.rop.client.ClientLocalRuntime;
 import org.apache.cayenne.configuration.rop.client.ClientRuntime;
-import org.apache.cayenne.configuration.rop.client.ProtostuffClientModule;
+import org.apache.cayenne.configuration.rop.client.ProtostuffModule;
 import org.apache.cayenne.configuration.server.ServerRuntime;
 import org.apache.cayenne.rop.ROPSerializationService;
 import org.apache.cayenne.rop.protostuff.persistent.ClientMtTable1;
@@ -60,7 +60,7 @@ public class ProtostuffROPSerializationServiceIT {
         ClientRuntime clientRuntime = new ClientLocalRuntime(
                 new ServerRuntime("cayenne-protostuff.xml").getInjector(),
                 Collections.emptyMap(),
-                new ProtostuffClientModule());
+                new ProtostuffModule());
 
         ObjectContext context = clientRuntime.newContext();
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable1.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable1.java
index 6b7853b..7a07d5f 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable1.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable1.java
@@ -1,12 +1,12 @@
 package org.apache.cayenne.rop.protostuff.persistent;
 
-import org.apache.cayenne.rop.protostuff.persistent.auto._ClientMtTable1;
-
-/**
- * A persistent class mapped as "MtTable1" Cayenne entity.
- */
-public class ClientMtTable1 extends _ClientMtTable1 {
-
-     private static final long serialVersionUID = 1L; 
-     
-}
+import org.apache.cayenne.rop.protostuff.persistent.auto._ClientMtTable1;
+
+/**
+ * A persistent class mapped as "MtTable1" Cayenne entity.
+ */
+public class ClientMtTable1 extends _ClientMtTable1 {
+
+     private static final long serialVersionUID = 1L; 
+     
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable2.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable2.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable2.java
index 15d1119..c17b1c1 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable2.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/ClientMtTable2.java
@@ -1,12 +1,12 @@
 package org.apache.cayenne.rop.protostuff.persistent;
 
-import org.apache.cayenne.rop.protostuff.persistent.auto._ClientMtTable2;
-
-/**
- * A persistent class mapped as "MtTable2" Cayenne entity.
- */
-public class ClientMtTable2 extends _ClientMtTable2 {
-
-     private static final long serialVersionUID = 1L; 
-     
-}
+import org.apache.cayenne.rop.protostuff.persistent.auto._ClientMtTable2;
+
+/**
+ * A persistent class mapped as "MtTable2" Cayenne entity.
+ */
+public class ClientMtTable2 extends _ClientMtTable2 {
+
+     private static final long serialVersionUID = 1L; 
+     
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable1.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable1.java
index 21b1f3f..db169a2 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable1.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable1.java
@@ -1,9 +1,9 @@
 package org.apache.cayenne.rop.protostuff.persistent;
 
-import org.apache.cayenne.rop.protostuff.persistent.auto._MtTable1;
-
-public class MtTable1 extends _MtTable1 {
-
-    private static final long serialVersionUID = 1L; 
-
-}
+import org.apache.cayenne.rop.protostuff.persistent.auto._MtTable1;
+
+public class MtTable1 extends _MtTable1 {
+
+    private static final long serialVersionUID = 1L; 
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable2.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable2.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable2.java
index 7f3888f..aa23626 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable2.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/MtTable2.java
@@ -1,9 +1,9 @@
 package org.apache.cayenne.rop.protostuff.persistent;
 
-import org.apache.cayenne.rop.protostuff.persistent.auto._MtTable2;
-
-public class MtTable2 extends _MtTable2 {
-
-    private static final long serialVersionUID = 1L; 
-
-}
+import org.apache.cayenne.rop.protostuff.persistent.auto._MtTable2;
+
+public class MtTable2 extends _MtTable2 {
+
+    private static final long serialVersionUID = 1L; 
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable1.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable1.java
index 74febc7..150cb0e 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable1.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable1.java
@@ -1,191 +1,191 @@
-package org.apache.cayenne.rop.protostuff.persistent.auto;
-
-import org.apache.cayenne.PersistentObject;
-import org.apache.cayenne.exp.Property;
-import org.apache.cayenne.rop.protostuff.persistent.ClientMtTable2;
-import org.apache.cayenne.util.PersistentObjectList;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.util.Date;
-import java.util.List;
-
-/**
- * A generated persistent class mapped as "MtTable1" Cayenne entity. It is a 
good idea to
- * avoid changing this class manually, since it will be overwritten next time 
code is
- * regenerated. If you need to make any customizations, put them in a subclass.
- */
-public abstract class _ClientMtTable1 extends PersistentObject {
-
-    public static final Property<LocalDate> DATE_ATTRIBUTE = new 
Property<LocalDate>("dateAttribute");
-    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
-    public static final Property<Date> OLD_DATE_ATTRIBUTE = new 
Property<Date>("oldDateAttribute");
-    public static final Property<String> SERVER_ATTRIBUTE = new 
Property<String>("serverAttribute");
-    public static final Property<LocalTime> TIME_ATTRIBUTE = new 
Property<LocalTime>("timeAttribute");
-    public static final Property<LocalDateTime> TIMESTAMP_ATTRIBUTE = new 
Property<LocalDateTime>("timestampAttribute");
-    public static final Property<List<ClientMtTable2>> TABLE2ARRAY = new 
Property<List<ClientMtTable2>>("table2Array");
-
-    protected LocalDate dateAttribute;
-    protected String globalAttribute;
-    protected Date oldDateAttribute;
-    protected String serverAttribute;
-    protected LocalTime timeAttribute;
-    protected LocalDateTime timestampAttribute;
-    protected List<ClientMtTable2> table2Array;
-
-    public LocalDate getDateAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "dateAttribute", false);
-        }
-
-        return dateAttribute;
-    }
-    public void setDateAttribute(LocalDate dateAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "dateAttribute", false);
-        }
-
-        Object oldValue = this.dateAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "dateAttribute", oldValue, 
dateAttribute);
-        }
-        
-        this.dateAttribute = dateAttribute;
-    }
-
-    public String getGlobalAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "globalAttribute", false);
-        }
-
-        return globalAttribute;
-    }
-    public void setGlobalAttribute(String globalAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "globalAttribute", false);
-        }
-
-        Object oldValue = this.globalAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "globalAttribute", oldValue, 
globalAttribute);
-        }
-        
-        this.globalAttribute = globalAttribute;
-    }
-
-    public Date getOldDateAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "oldDateAttribute", false);
-        }
-
-        return oldDateAttribute;
-    }
-    public void setOldDateAttribute(Date oldDateAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "oldDateAttribute", false);
-        }
-
-        Object oldValue = this.oldDateAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "oldDateAttribute", oldValue, 
oldDateAttribute);
-        }
-        
-        this.oldDateAttribute = oldDateAttribute;
-    }
-
-    public String getServerAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "serverAttribute", false);
-        }
-
-        return serverAttribute;
-    }
-    public void setServerAttribute(String serverAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "serverAttribute", false);
-        }
-
-        Object oldValue = this.serverAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "serverAttribute", oldValue, 
serverAttribute);
-        }
-        
-        this.serverAttribute = serverAttribute;
-    }
-
-    public LocalTime getTimeAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "timeAttribute", false);
-        }
-
-        return timeAttribute;
-    }
-    public void setTimeAttribute(LocalTime timeAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "timeAttribute", false);
-        }
-
-        Object oldValue = this.timeAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "timeAttribute", oldValue, 
timeAttribute);
-        }
-        
-        this.timeAttribute = timeAttribute;
-    }
-
-    public LocalDateTime getTimestampAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "timestampAttribute", false);
-        }
-
-        return timestampAttribute;
-    }
-    public void setTimestampAttribute(LocalDateTime timestampAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "timestampAttribute", false);
-        }
-
-        Object oldValue = this.timestampAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "timestampAttribute", 
oldValue, timestampAttribute);
-        }
-        
-        this.timestampAttribute = timestampAttribute;
-    }
-
-    public List<ClientMtTable2> getTable2Array() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "table2Array", true);
-        } else if (this.table2Array == null) {
-               this.table2Array = new PersistentObjectList(this, 
"table2Array");
-               }
-
-        return table2Array;
-    }
-    public void addToTable2Array(ClientMtTable2 object) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "table2Array", true);
-        } else if (this.table2Array == null) {
-               this.table2Array = new PersistentObjectList(this, 
"table2Array");
-               }
-
-        this.table2Array.add(object);
-    }
-    public void removeFromTable2Array(ClientMtTable2 object) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "table2Array", true);
-        } else if (this.table2Array == null) {
-               this.table2Array = new PersistentObjectList(this, 
"table2Array");
-               }
-
-        this.table2Array.remove(object);
-    }
-
-}
+package org.apache.cayenne.rop.protostuff.persistent.auto;
+
+import org.apache.cayenne.PersistentObject;
+import org.apache.cayenne.exp.Property;
+import org.apache.cayenne.rop.protostuff.persistent.ClientMtTable2;
+import org.apache.cayenne.util.PersistentObjectList;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * A generated persistent class mapped as "MtTable1" Cayenne entity. It is a 
good idea to
+ * avoid changing this class manually, since it will be overwritten next time 
code is
+ * regenerated. If you need to make any customizations, put them in a subclass.
+ */
+public abstract class _ClientMtTable1 extends PersistentObject {
+
+    public static final Property<LocalDate> DATE_ATTRIBUTE = new 
Property<LocalDate>("dateAttribute");
+    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
+    public static final Property<Date> OLD_DATE_ATTRIBUTE = new 
Property<Date>("oldDateAttribute");
+    public static final Property<String> SERVER_ATTRIBUTE = new 
Property<String>("serverAttribute");
+    public static final Property<LocalTime> TIME_ATTRIBUTE = new 
Property<LocalTime>("timeAttribute");
+    public static final Property<LocalDateTime> TIMESTAMP_ATTRIBUTE = new 
Property<LocalDateTime>("timestampAttribute");
+    public static final Property<List<ClientMtTable2>> TABLE2ARRAY = new 
Property<List<ClientMtTable2>>("table2Array");
+
+    protected LocalDate dateAttribute;
+    protected String globalAttribute;
+    protected Date oldDateAttribute;
+    protected String serverAttribute;
+    protected LocalTime timeAttribute;
+    protected LocalDateTime timestampAttribute;
+    protected List<ClientMtTable2> table2Array;
+
+    public LocalDate getDateAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "dateAttribute", false);
+        }
+
+        return dateAttribute;
+    }
+    public void setDateAttribute(LocalDate dateAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "dateAttribute", false);
+        }
+
+        Object oldValue = this.dateAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "dateAttribute", oldValue, 
dateAttribute);
+        }
+        
+        this.dateAttribute = dateAttribute;
+    }
+
+    public String getGlobalAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "globalAttribute", false);
+        }
+
+        return globalAttribute;
+    }
+    public void setGlobalAttribute(String globalAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "globalAttribute", false);
+        }
+
+        Object oldValue = this.globalAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "globalAttribute", oldValue, 
globalAttribute);
+        }
+        
+        this.globalAttribute = globalAttribute;
+    }
+
+    public Date getOldDateAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "oldDateAttribute", false);
+        }
+
+        return oldDateAttribute;
+    }
+    public void setOldDateAttribute(Date oldDateAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "oldDateAttribute", false);
+        }
+
+        Object oldValue = this.oldDateAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "oldDateAttribute", oldValue, 
oldDateAttribute);
+        }
+        
+        this.oldDateAttribute = oldDateAttribute;
+    }
+
+    public String getServerAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "serverAttribute", false);
+        }
+
+        return serverAttribute;
+    }
+    public void setServerAttribute(String serverAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "serverAttribute", false);
+        }
+
+        Object oldValue = this.serverAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "serverAttribute", oldValue, 
serverAttribute);
+        }
+        
+        this.serverAttribute = serverAttribute;
+    }
+
+    public LocalTime getTimeAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "timeAttribute", false);
+        }
+
+        return timeAttribute;
+    }
+    public void setTimeAttribute(LocalTime timeAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "timeAttribute", false);
+        }
+
+        Object oldValue = this.timeAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "timeAttribute", oldValue, 
timeAttribute);
+        }
+        
+        this.timeAttribute = timeAttribute;
+    }
+
+    public LocalDateTime getTimestampAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "timestampAttribute", false);
+        }
+
+        return timestampAttribute;
+    }
+    public void setTimestampAttribute(LocalDateTime timestampAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "timestampAttribute", false);
+        }
+
+        Object oldValue = this.timestampAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "timestampAttribute", 
oldValue, timestampAttribute);
+        }
+        
+        this.timestampAttribute = timestampAttribute;
+    }
+
+    public List<ClientMtTable2> getTable2Array() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "table2Array", true);
+        } else if (this.table2Array == null) {
+               this.table2Array = new PersistentObjectList(this, 
"table2Array");
+               }
+
+        return table2Array;
+    }
+    public void addToTable2Array(ClientMtTable2 object) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "table2Array", true);
+        } else if (this.table2Array == null) {
+               this.table2Array = new PersistentObjectList(this, 
"table2Array");
+               }
+
+        this.table2Array.add(object);
+    }
+    public void removeFromTable2Array(ClientMtTable2 object) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "table2Array", true);
+        } else if (this.table2Array == null) {
+               this.table2Array = new PersistentObjectList(this, 
"table2Array");
+               }
+
+        this.table2Array.remove(object);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable2.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable2.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable2.java
index 2faf6ef..b4432a1 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable2.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_ClientMtTable2.java
@@ -4,66 +4,66 @@ import org.apache.cayenne.PersistentObject;
 import org.apache.cayenne.ValueHolder;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.rop.protostuff.persistent.ClientMtTable1;
-import org.apache.cayenne.util.PersistentObjectHolder;
-
-/**
- * A generated persistent class mapped as "MtTable2" Cayenne entity. It is a 
good idea to
- * avoid changing this class manually, since it will be overwritten next time 
code is
- * regenerated. If you need to make any customizations, put them in a subclass.
- */
-public abstract class _ClientMtTable2 extends PersistentObject {
-
-    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
-    public static final Property<ClientMtTable1> TABLE1 = new 
Property<ClientMtTable1>("table1");
-
-    protected String globalAttribute;
-    protected ValueHolder table1;
-
-    public String getGlobalAttribute() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "globalAttribute", false);
-        }
-
-        return globalAttribute;
-    }
-    public void setGlobalAttribute(String globalAttribute) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "globalAttribute", false);
-        }
-
-        Object oldValue = this.globalAttribute;
-        // notify objectContext about simple property change
-        if(objectContext != null) {
-            objectContext.propertyChanged(this, "globalAttribute", oldValue, 
globalAttribute);
-        }
-        
-        this.globalAttribute = globalAttribute;
-    }
-
-    public ClientMtTable1 getTable1() {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "table1", true);
-        } else if (this.table1 == null) {
-               this.table1 = new PersistentObjectHolder(this, "table1");
-               }
-
-        return (ClientMtTable1) table1.getValue();
-    }
-    public void setTable1(ClientMtTable1 table1) {
-        if(objectContext != null) {
-            objectContext.prepareForAccess(this, "table1", true);
-        } else if (this.table1 == null) {
-               this.table1 = new PersistentObjectHolder(this, "table1");
-               }
-
-        // note how we notify ObjectContext of change BEFORE the object is 
actually
-        // changed... this is needed to take a valid current snapshot
-        Object oldValue = this.table1.getValueDirectly();
-        if (objectContext != null) {
-               objectContext.propertyChanged(this, "table1", oldValue, table1);
-        }
-        
-        this.table1.setValue(table1);
-    }
-
-}
+import org.apache.cayenne.util.PersistentObjectHolder;
+
+/**
+ * A generated persistent class mapped as "MtTable2" Cayenne entity. It is a 
good idea to
+ * avoid changing this class manually, since it will be overwritten next time 
code is
+ * regenerated. If you need to make any customizations, put them in a subclass.
+ */
+public abstract class _ClientMtTable2 extends PersistentObject {
+
+    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
+    public static final Property<ClientMtTable1> TABLE1 = new 
Property<ClientMtTable1>("table1");
+
+    protected String globalAttribute;
+    protected ValueHolder table1;
+
+    public String getGlobalAttribute() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "globalAttribute", false);
+        }
+
+        return globalAttribute;
+    }
+    public void setGlobalAttribute(String globalAttribute) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "globalAttribute", false);
+        }
+
+        Object oldValue = this.globalAttribute;
+        // notify objectContext about simple property change
+        if(objectContext != null) {
+            objectContext.propertyChanged(this, "globalAttribute", oldValue, 
globalAttribute);
+        }
+        
+        this.globalAttribute = globalAttribute;
+    }
+
+    public ClientMtTable1 getTable1() {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "table1", true);
+        } else if (this.table1 == null) {
+               this.table1 = new PersistentObjectHolder(this, "table1");
+               }
+
+        return (ClientMtTable1) table1.getValue();
+    }
+    public void setTable1(ClientMtTable1 table1) {
+        if(objectContext != null) {
+            objectContext.prepareForAccess(this, "table1", true);
+        } else if (this.table1 == null) {
+               this.table1 = new PersistentObjectHolder(this, "table1");
+               }
+
+        // note how we notify ObjectContext of change BEFORE the object is 
actually
+        // changed... this is needed to take a valid current snapshot
+        Object oldValue = this.table1.getValueDirectly();
+        if (objectContext != null) {
+               objectContext.propertyChanged(this, "table1", oldValue, table1);
+        }
+        
+        this.table1.setValue(table1);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable1.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable1.java
index 0eb33bd..edc4630 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable1.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable1.java
@@ -8,80 +8,80 @@ import java.util.List;
 
 import org.apache.cayenne.CayenneDataObject;
 import org.apache.cayenne.exp.Property;
-import org.apache.cayenne.rop.protostuff.persistent.MtTable2;
-
-/**
- * Class _MtTable1 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 _MtTable1 extends CayenneDataObject {
-
-    private static final long serialVersionUID = 1L; 
-
-    public static final String TABLE1_ID_PK_COLUMN = "TABLE1_ID";
-
-    public static final Property<LocalDate> DATE_ATTRIBUTE = new 
Property<LocalDate>("dateAttribute");
-    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
-    public static final Property<Date> OLD_DATE_ATTRIBUTE = new 
Property<Date>("oldDateAttribute");
-    public static final Property<String> SERVER_ATTRIBUTE = new 
Property<String>("serverAttribute");
-    public static final Property<LocalTime> TIME_ATTRIBUTE = new 
Property<LocalTime>("timeAttribute");
-    public static final Property<LocalDateTime> TIMESTAMP_ATTRIBUTE = new 
Property<LocalDateTime>("timestampAttribute");
-    public static final Property<List<MtTable2>> TABLE2ARRAY = new 
Property<List<MtTable2>>("table2Array");
-
-    public void setDateAttribute(LocalDate dateAttribute) {
-        writeProperty("dateAttribute", dateAttribute);
-    }
-    public LocalDate getDateAttribute() {
-        return (LocalDate)readProperty("dateAttribute");
-    }
-
-    public void setGlobalAttribute(String globalAttribute) {
-        writeProperty("globalAttribute", globalAttribute);
-    }
-    public String getGlobalAttribute() {
-        return (String)readProperty("globalAttribute");
-    }
-
-    public void setOldDateAttribute(Date oldDateAttribute) {
-        writeProperty("oldDateAttribute", oldDateAttribute);
-    }
-    public Date getOldDateAttribute() {
-        return (Date)readProperty("oldDateAttribute");
-    }
-
-    public void setServerAttribute(String serverAttribute) {
-        writeProperty("serverAttribute", serverAttribute);
-    }
-    public String getServerAttribute() {
-        return (String)readProperty("serverAttribute");
-    }
-
-    public void setTimeAttribute(LocalTime timeAttribute) {
-        writeProperty("timeAttribute", timeAttribute);
-    }
-    public LocalTime getTimeAttribute() {
-        return (LocalTime)readProperty("timeAttribute");
-    }
-
-    public void setTimestampAttribute(LocalDateTime timestampAttribute) {
-        writeProperty("timestampAttribute", timestampAttribute);
-    }
-    public LocalDateTime getTimestampAttribute() {
-        return (LocalDateTime)readProperty("timestampAttribute");
-    }
-
-    public void addToTable2Array(MtTable2 obj) {
-        addToManyTarget("table2Array", obj, true);
-    }
-    public void removeFromTable2Array(MtTable2 obj) {
-        removeToManyTarget("table2Array", obj, true);
-    }
-    @SuppressWarnings("unchecked")
-    public List<MtTable2> getTable2Array() {
-        return (List<MtTable2>)readProperty("table2Array");
-    }
-
-
-}
+import org.apache.cayenne.rop.protostuff.persistent.MtTable2;
+
+/**
+ * Class _MtTable1 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 _MtTable1 extends CayenneDataObject {
+
+    private static final long serialVersionUID = 1L; 
+
+    public static final String TABLE1_ID_PK_COLUMN = "TABLE1_ID";
+
+    public static final Property<LocalDate> DATE_ATTRIBUTE = new 
Property<LocalDate>("dateAttribute");
+    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
+    public static final Property<Date> OLD_DATE_ATTRIBUTE = new 
Property<Date>("oldDateAttribute");
+    public static final Property<String> SERVER_ATTRIBUTE = new 
Property<String>("serverAttribute");
+    public static final Property<LocalTime> TIME_ATTRIBUTE = new 
Property<LocalTime>("timeAttribute");
+    public static final Property<LocalDateTime> TIMESTAMP_ATTRIBUTE = new 
Property<LocalDateTime>("timestampAttribute");
+    public static final Property<List<MtTable2>> TABLE2ARRAY = new 
Property<List<MtTable2>>("table2Array");
+
+    public void setDateAttribute(LocalDate dateAttribute) {
+        writeProperty("dateAttribute", dateAttribute);
+    }
+    public LocalDate getDateAttribute() {
+        return (LocalDate)readProperty("dateAttribute");
+    }
+
+    public void setGlobalAttribute(String globalAttribute) {
+        writeProperty("globalAttribute", globalAttribute);
+    }
+    public String getGlobalAttribute() {
+        return (String)readProperty("globalAttribute");
+    }
+
+    public void setOldDateAttribute(Date oldDateAttribute) {
+        writeProperty("oldDateAttribute", oldDateAttribute);
+    }
+    public Date getOldDateAttribute() {
+        return (Date)readProperty("oldDateAttribute");
+    }
+
+    public void setServerAttribute(String serverAttribute) {
+        writeProperty("serverAttribute", serverAttribute);
+    }
+    public String getServerAttribute() {
+        return (String)readProperty("serverAttribute");
+    }
+
+    public void setTimeAttribute(LocalTime timeAttribute) {
+        writeProperty("timeAttribute", timeAttribute);
+    }
+    public LocalTime getTimeAttribute() {
+        return (LocalTime)readProperty("timeAttribute");
+    }
+
+    public void setTimestampAttribute(LocalDateTime timestampAttribute) {
+        writeProperty("timestampAttribute", timestampAttribute);
+    }
+    public LocalDateTime getTimestampAttribute() {
+        return (LocalDateTime)readProperty("timestampAttribute");
+    }
+
+    public void addToTable2Array(MtTable2 obj) {
+        addToManyTarget("table2Array", obj, true);
+    }
+    public void removeFromTable2Array(MtTable2 obj) {
+        removeToManyTarget("table2Array", obj, true);
+    }
+    @SuppressWarnings("unchecked")
+    public List<MtTable2> getTable2Array() {
+        return (List<MtTable2>)readProperty("table2Array");
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable2.java
----------------------------------------------------------------------
diff --git 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable2.java
 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable2.java
index 682e272..db226a8 100644
--- 
a/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable2.java
+++ 
b/cayenne-protostuff/src/test/java/org/apache/cayenne/rop/protostuff/persistent/auto/_MtTable2.java
@@ -2,37 +2,37 @@ package org.apache.cayenne.rop.protostuff.persistent.auto;
 
 import org.apache.cayenne.CayenneDataObject;
 import org.apache.cayenne.exp.Property;
-import org.apache.cayenne.rop.protostuff.persistent.MtTable1;
-
-/**
- * Class _MtTable2 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 _MtTable2 extends CayenneDataObject {
-
-    private static final long serialVersionUID = 1L; 
-
-    public static final String TABLE2_ID_PK_COLUMN = "TABLE2_ID";
-
-    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
-    public static final Property<MtTable1> TABLE1 = new 
Property<MtTable1>("table1");
-
-    public void setGlobalAttribute(String globalAttribute) {
-        writeProperty("globalAttribute", globalAttribute);
-    }
-    public String getGlobalAttribute() {
-        return (String)readProperty("globalAttribute");
-    }
-
-    public void setTable1(MtTable1 table1) {
-        setToOneTarget("table1", table1, true);
-    }
-
-    public MtTable1 getTable1() {
-        return (MtTable1)readProperty("table1");
-    }
-
-
-}
+import org.apache.cayenne.rop.protostuff.persistent.MtTable1;
+
+/**
+ * Class _MtTable2 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 _MtTable2 extends CayenneDataObject {
+
+    private static final long serialVersionUID = 1L; 
+
+    public static final String TABLE2_ID_PK_COLUMN = "TABLE2_ID";
+
+    public static final Property<String> GLOBAL_ATTRIBUTE = new 
Property<String>("globalAttribute");
+    public static final Property<MtTable1> TABLE1 = new 
Property<MtTable1>("table1");
+
+    public void setGlobalAttribute(String globalAttribute) {
+        writeProperty("globalAttribute", globalAttribute);
+    }
+    public String getGlobalAttribute() {
+        return (String)readProperty("globalAttribute");
+    }
+
+    public void setTable1(MtTable1 table1) {
+        setToOneTarget("table1", table1, true);
+    }
+
+    public MtTable1 getTable1() {
+        return (MtTable1)readProperty("table1");
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/0c26497d/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
 
b/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
index 486b0e9..99cccbf 100644
--- 
a/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
+++ 
b/cayenne-server/src/main/java/org/apache/cayenne/rop/ROPSerializationService.java
@@ -22,6 +22,11 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+/**
+ * ROP serialization service
+ *
+ * @since 4.0
+ */
 public interface ROPSerializationService {
 
     byte[] serialize(Object object) throws IOException;

Reply via email to