http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_AbstractPerson.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_AbstractPerson.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_AbstractPerson.java
index aa12f80..e7dba28 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_AbstractPerson.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_AbstractPerson.java
@@ -1,8 +1,11 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
-import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.PersonNotes;
 
@@ -12,7 +15,7 @@ import 
org.apache.cayenne.testdo.inheritance_people.PersonNotes;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _AbstractPerson extends CayenneDataObject {
+public abstract class _AbstractPerson extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -22,30 +25,105 @@ public abstract class _AbstractPerson extends 
CayenneDataObject {
     public static final Property<String> PERSON_TYPE = 
Property.create("personType", String.class);
     public static final Property<List<PersonNotes>> NOTES = 
Property.create("notes", List.class);
 
+    protected String name;
+    protected String personType;
+
+    protected Object notes;
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void setPersonType(String personType) {
-        writeProperty("personType", personType);
+        beforePropertyWrite("personType", this.personType, personType);
+        this.personType = personType;
     }
+
     public String getPersonType() {
-        return (String)readProperty("personType");
+        beforePropertyRead("personType");
+        return personType;
     }
 
     public void addToNotes(PersonNotes obj) {
         addToManyTarget("notes", obj, true);
     }
+
     public void removeFromNotes(PersonNotes obj) {
         removeToManyTarget("notes", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<PersonNotes> getNotes() {
         return (List<PersonNotes>)readProperty("notes");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "personType":
+                return this.personType;
+            case "notes":
+                return this.notes;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "personType":
+                this.personType = (String)val;
+                break;
+            case "notes":
+                this.notes = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(personType);
+        out.writeObject(notes);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        personType = (String)in.readObject();
+        notes = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Address.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Address.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Address.java
index 762e3be..a8e18db 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Address.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Address.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.Employee;
 
@@ -10,7 +14,7 @@ import org.apache.cayenne.testdo.inheritance_people.Employee;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _Address extends CayenneDataObject {
+public abstract class _Address extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -19,11 +23,18 @@ public abstract class _Address extends CayenneDataObject {
     public static final Property<String> CITY = Property.create("city", 
String.class);
     public static final Property<Employee> TO_EMPLOYEE = 
Property.create("toEmployee", Employee.class);
 
+    protected String city;
+
+    protected Object toEmployee;
+
     public void setCity(String city) {
-        writeProperty("city", city);
+        beforePropertyWrite("city", this.city, city);
+        this.city = city;
     }
+
     public String getCity() {
-        return (String)readProperty("city");
+        beforePropertyRead("city");
+        return city;
     }
 
     public void setToEmployee(Employee toEmployee) {
@@ -34,5 +45,60 @@ public abstract class _Address extends CayenneDataObject {
         return (Employee)readProperty("toEmployee");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "city":
+                return this.city;
+            case "toEmployee":
+                return this.toEmployee;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "city":
+                this.city = (String)val;
+                break;
+            case "toEmployee":
+                this.toEmployee = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(city);
+        out.writeObject(toEmployee);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        city = (String)in.readObject();
+        toEmployee = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_ClientCompany.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_ClientCompany.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_ClientCompany.java
index 0aa752f..856cfa9 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_ClientCompany.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_ClientCompany.java
@@ -1,8 +1,11 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
-import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.CustomerRepresentative;
 
@@ -12,7 +15,7 @@ import 
org.apache.cayenne.testdo.inheritance_people.CustomerRepresentative;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _ClientCompany extends CayenneDataObject {
+public abstract class _ClientCompany extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -21,23 +24,87 @@ public abstract class _ClientCompany extends 
CayenneDataObject {
     public static final Property<String> NAME = Property.create("name", 
String.class);
     public static final Property<List<CustomerRepresentative>> REPRESENTATIVES 
= Property.create("representatives", List.class);
 
+    protected String name;
+
+    protected Object representatives;
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void addToRepresentatives(CustomerRepresentative obj) {
         addToManyTarget("representatives", obj, true);
     }
+
     public void removeFromRepresentatives(CustomerRepresentative obj) {
         removeToManyTarget("representatives", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<CustomerRepresentative> getRepresentatives() {
         return (List<CustomerRepresentative>)readProperty("representatives");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "representatives":
+                return this.representatives;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "representatives":
+                this.representatives = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(representatives);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        representatives = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_CustomerRepresentative.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_CustomerRepresentative.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_CustomerRepresentative.java
index 4aac968..a2e0f3b 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_CustomerRepresentative.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_CustomerRepresentative.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.AbstractPerson;
 import org.apache.cayenne.testdo.inheritance_people.ClientCompany;
@@ -19,11 +23,18 @@ public abstract class _CustomerRepresentative extends 
AbstractPerson {
     public static final Property<String> CLIENT_CONTACT_TYPE = 
Property.create("clientContactType", String.class);
     public static final Property<ClientCompany> TO_CLIENT_COMPANY = 
Property.create("toClientCompany", ClientCompany.class);
 
+    protected String clientContactType;
+
+    protected Object toClientCompany;
+
     public void setClientContactType(String clientContactType) {
-        writeProperty("clientContactType", clientContactType);
+        beforePropertyWrite("clientContactType", this.clientContactType, 
clientContactType);
+        this.clientContactType = clientContactType;
     }
+
     public String getClientContactType() {
-        return (String)readProperty("clientContactType");
+        beforePropertyRead("clientContactType");
+        return clientContactType;
     }
 
     public void setToClientCompany(ClientCompany toClientCompany) {
@@ -34,5 +45,60 @@ public abstract class _CustomerRepresentative extends 
AbstractPerson {
         return (ClientCompany)readProperty("toClientCompany");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "clientContactType":
+                return this.clientContactType;
+            case "toClientCompany":
+                return this.toClientCompany;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "clientContactType":
+                this.clientContactType = (String)val;
+                break;
+            case "toClientCompany":
+                this.toClientCompany = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(clientContactType);
+        out.writeObject(toClientCompany);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        clientContactType = (String)in.readObject();
+        toClientCompany = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Department.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Department.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Department.java
index b52592a..b379e04 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Department.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Department.java
@@ -1,8 +1,11 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
-import org.apache.cayenne.CayenneDataObject;
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.Employee;
 import org.apache.cayenne.testdo.inheritance_people.Manager;
@@ -13,7 +16,7 @@ import org.apache.cayenne.testdo.inheritance_people.Manager;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _Department extends CayenneDataObject {
+public abstract class _Department extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -23,25 +26,34 @@ public abstract class _Department extends CayenneDataObject 
{
     public static final Property<List<Employee>> EMPLOYEES = 
Property.create("employees", List.class);
     public static final Property<Manager> TO_MANAGER = 
Property.create("toManager", Manager.class);
 
+    protected String name;
+
+    protected Object employees;
+    protected Object toManager;
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void addToEmployees(Employee obj) {
         addToManyTarget("employees", obj, true);
     }
+
     public void removeFromEmployees(Employee obj) {
         removeToManyTarget("employees", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<Employee> getEmployees() {
         return (List<Employee>)readProperty("employees");
     }
 
-
     public void setToManager(Manager toManager) {
         setToOneTarget("toManager", toManager, true);
     }
@@ -50,5 +62,67 @@ public abstract class _Department extends CayenneDataObject {
         return (Manager)readProperty("toManager");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "employees":
+                return this.employees;
+            case "toManager":
+                return this.toManager;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "employees":
+                this.employees = val;
+                break;
+            case "toManager":
+                this.toManager = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(employees);
+        out.writeObject(toManager);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        employees = in.readObject();
+        toManager = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Employee.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Employee.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Employee.java
index 6cebc42..81c6d93 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Employee.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Employee.java
@@ -1,5 +1,8 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
 import org.apache.cayenne.exp.Property;
@@ -23,25 +26,34 @@ public abstract class _Employee extends AbstractPerson {
     public static final Property<List<Address>> ADDRESSES = 
Property.create("addresses", List.class);
     public static final Property<Department> TO_DEPARTMENT = 
Property.create("toDepartment", Department.class);
 
+    protected Float salary;
+
+    protected Object addresses;
+    protected Object toDepartment;
+
     public void setSalary(Float salary) {
-        writeProperty("salary", salary);
+        beforePropertyWrite("salary", this.salary, salary);
+        this.salary = salary;
     }
+
     public Float getSalary() {
-        return (Float)readProperty("salary");
+        beforePropertyRead("salary");
+        return salary;
     }
 
     public void addToAddresses(Address obj) {
         addToManyTarget("addresses", obj, true);
     }
+
     public void removeFromAddresses(Address obj) {
         removeToManyTarget("addresses", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<Address> getAddresses() {
         return (List<Address>)readProperty("addresses");
     }
 
-
     public void setToDepartment(Department toDepartment) {
         setToOneTarget("toDepartment", toDepartment, true);
     }
@@ -50,5 +62,67 @@ public abstract class _Employee extends AbstractPerson {
         return (Department)readProperty("toDepartment");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "salary":
+                return this.salary;
+            case "addresses":
+                return this.addresses;
+            case "toDepartment":
+                return this.toDepartment;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "salary":
+                this.salary = (Float)val;
+                break;
+            case "addresses":
+                this.addresses = val;
+                break;
+            case "toDepartment":
+                this.toDepartment = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(salary);
+        out.writeObject(addresses);
+        out.writeObject(toDepartment);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        salary = (Float)in.readObject();
+        addresses = in.readObject();
+        toDepartment = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Manager.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Manager.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Manager.java
index b56dd23..cad5dbf 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Manager.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_Manager.java
@@ -1,5 +1,8 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
 import org.apache.cayenne.exp.Property;
@@ -20,16 +23,69 @@ public abstract class _Manager extends Employee {
 
     public static final Property<List<Department>> MANAGED_DEPARTMENTS = 
Property.create("managedDepartments", List.class);
 
+
+    protected Object managedDepartments;
+
     public void addToManagedDepartments(Department obj) {
         addToManyTarget("managedDepartments", obj, true);
     }
+
     public void removeFromManagedDepartments(Department obj) {
         removeToManyTarget("managedDepartments", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<Department> getManagedDepartments() {
         return (List<Department>)readProperty("managedDepartments");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "managedDepartments":
+                return this.managedDepartments;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "managedDepartments":
+                this.managedDepartments = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(managedDepartments);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        managedDepartments = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_PersonNotes.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_PersonNotes.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_PersonNotes.java
index 49868b9..951773f 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_PersonNotes.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_people/auto/_PersonNotes.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_people.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_people.AbstractPerson;
 
@@ -10,7 +14,7 @@ import 
org.apache.cayenne.testdo.inheritance_people.AbstractPerson;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _PersonNotes extends CayenneDataObject {
+public abstract class _PersonNotes extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -19,11 +23,18 @@ public abstract class _PersonNotes extends 
CayenneDataObject {
     public static final Property<String> NOTES = Property.create("notes", 
String.class);
     public static final Property<AbstractPerson> PERSON = 
Property.create("person", AbstractPerson.class);
 
+    protected String notes;
+
+    protected Object person;
+
     public void setNotes(String notes) {
-        writeProperty("notes", notes);
+        beforePropertyWrite("notes", this.notes, notes);
+        this.notes = notes;
     }
+
     public String getNotes() {
-        return (String)readProperty("notes");
+        beforePropertyRead("notes");
+        return notes;
     }
 
     public void setPerson(AbstractPerson person) {
@@ -34,5 +45,60 @@ public abstract class _PersonNotes extends CayenneDataObject 
{
         return (AbstractPerson)readProperty("person");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "notes":
+                return this.notes;
+            case "person":
+                return this.person;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "notes":
+                this.notes = (String)val;
+                break;
+            case "person":
+                this.person = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(notes);
+        out.writeObject(person);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        notes = (String)in.readObject();
+        person = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Root.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Root.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Root.java
index 4dd6db4..9a2c384 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Root.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Root.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
@@ -9,7 +13,7 @@ import org.apache.cayenne.exp.Property;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _Iv1Root extends CayenneDataObject {
+public abstract class _Iv1Root extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -18,18 +22,84 @@ public abstract class _Iv1Root extends CayenneDataObject {
     public static final Property<String> DISCRIMINATOR = 
Property.create("discriminator", String.class);
     public static final Property<String> NAME = Property.create("name", 
String.class);
 
+    protected String discriminator;
+    protected String name;
+
+
     public void setDiscriminator(String discriminator) {
-        writeProperty("discriminator", discriminator);
+        beforePropertyWrite("discriminator", this.discriminator, 
discriminator);
+        this.discriminator = discriminator;
     }
+
     public String getDiscriminator() {
-        return (String)readProperty("discriminator");
+        beforePropertyRead("discriminator");
+        return discriminator;
     }
 
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "discriminator":
+                return this.discriminator;
+            case "name":
+                return this.name;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "discriminator":
+                this.discriminator = (String)val;
+                break;
+            case "name":
+                this.name = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(discriminator);
+        out.writeObject(name);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        discriminator = (String)in.readObject();
+        name = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Sub1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Sub1.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Sub1.java
index c758e1a..9087579 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Sub1.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv1Sub1.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.Iv1Root;
 
@@ -17,11 +21,66 @@ public abstract class _Iv1Sub1 extends Iv1Root {
 
     public static final Property<String> NAME = Property.create("name", 
String.class);
 
+    protected String name;
+
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Root.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Root.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Root.java
index b36cbaf..84434f5 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Root.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Root.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
@@ -9,7 +13,7 @@ import org.apache.cayenne.exp.Property;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _Iv2Root extends CayenneDataObject {
+public abstract class _Iv2Root extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -17,11 +21,66 @@ public abstract class _Iv2Root extends CayenneDataObject {
 
     public static final Property<String> DISCRIMINATOR = 
Property.create("discriminator", String.class);
 
+    protected String discriminator;
+
+
     public void setDiscriminator(String discriminator) {
-        writeProperty("discriminator", discriminator);
+        beforePropertyWrite("discriminator", this.discriminator, 
discriminator);
+        this.discriminator = discriminator;
     }
+
     public String getDiscriminator() {
-        return (String)readProperty("discriminator");
+        beforePropertyRead("discriminator");
+        return discriminator;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "discriminator":
+                return this.discriminator;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "discriminator":
+                this.discriminator = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(discriminator);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        discriminator = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Sub1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Sub1.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Sub1.java
index fb574b7..7fccf6c 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Sub1.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2Sub1.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.Iv2Root;
 import org.apache.cayenne.testdo.inheritance_vertical.Iv2X;
@@ -18,6 +22,9 @@ public abstract class _Iv2Sub1 extends Iv2Root {
 
     public static final Property<Iv2X> X = Property.create("x", Iv2X.class);
 
+
+    protected Object x;
+
     public void setX(Iv2X x) {
         setToOneTarget("x", x, true);
     }
@@ -26,5 +33,53 @@ public abstract class _Iv2Sub1 extends Iv2Root {
         return (Iv2X)readProperty("x");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "x":
+                return this.x;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "x":
+                this.x = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(x);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        x = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2X.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2X.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2X.java
index e6b6a57..c43ad20 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2X.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_Iv2X.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 
 /**
  * Class _Iv2X was generated by Cayenne.
@@ -8,11 +12,55 @@ import org.apache.cayenne.CayenneDataObject;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _Iv2X extends CayenneDataObject {
+public abstract class _Iv2X extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
     public static final String ID_PK_COLUMN = "ID";
 
 
+
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvAbstract.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvAbstract.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvAbstract.java
index 3eb93a3..021f9e3 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvAbstract.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvAbstract.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
@@ -9,7 +13,7 @@ import org.apache.cayenne.exp.Property;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _IvAbstract extends CayenneDataObject {
+public abstract class _IvAbstract extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -17,11 +21,66 @@ public abstract class _IvAbstract extends CayenneDataObject 
{
 
     public static final Property<String> TYPE = Property.create("type", 
String.class);
 
+    protected String type;
+
+
     public void setType(String type) {
-        writeProperty("type", type);
+        beforePropertyWrite("type", this.type, type);
+        this.type = type;
     }
+
     public String getType() {
-        return (String)readProperty("type");
+        beforePropertyRead("type");
+        return type;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "type":
+                return this.type;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "type":
+                this.type = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(type);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        type = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBase.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBase.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBase.java
index 59984a8..91b2119 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBase.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBase.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
@@ -9,7 +13,7 @@ import org.apache.cayenne.exp.Property;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _IvBase extends CayenneDataObject {
+public abstract class _IvBase extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -18,18 +22,84 @@ public abstract class _IvBase extends CayenneDataObject {
     public static final Property<String> NAME = Property.create("name", 
String.class);
     public static final Property<String> TYPE = Property.create("type", 
String.class);
 
+    protected String name;
+    protected String type;
+
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void setType(String type) {
-        writeProperty("type", type);
+        beforePropertyWrite("type", this.type, type);
+        this.type = type;
     }
+
     public String getType() {
-        return (String)readProperty("type");
+        beforePropertyRead("type");
+        return type;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "type":
+                return this.type;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "type":
+                this.type = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(type);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        type = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBaseWithLock.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBaseWithLock.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBaseWithLock.java
index 1fd3765..29dfc23 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBaseWithLock.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvBaseWithLock.java
@@ -1,34 +1,19 @@
-/*****************************************************************
- *   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.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
- * Class _IvBase was generated by Cayenne.
+ * Class _IvBaseWithLock 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 _IvBaseWithLock extends CayenneDataObject {
+public abstract class _IvBaseWithLock extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -37,18 +22,84 @@ public abstract class _IvBaseWithLock extends 
CayenneDataObject {
     public static final Property<String> NAME = Property.create("name", 
String.class);
     public static final Property<String> TYPE = Property.create("type", 
String.class);
 
+    protected String name;
+    protected String type;
+
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void setType(String type) {
-        writeProperty("type", type);
+        beforePropertyWrite("type", this.type, type);
+        this.type = type;
     }
+
     public String getType() {
-        return (String)readProperty("type");
+        beforePropertyRead("type");
+        return type;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "type":
+                return this.type;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "type":
+                this.type = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(type);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        type = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvConcrete.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvConcrete.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvConcrete.java
index bd260e1..898c954 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvConcrete.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvConcrete.java
@@ -1,5 +1,8 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.util.List;
 
 import org.apache.cayenne.exp.Property;
@@ -22,25 +25,34 @@ public abstract class _IvConcrete extends IvAbstract {
     public static final Property<List<IvConcrete>> CHILDREN = 
Property.create("children", List.class);
     public static final Property<IvConcrete> PARENT = 
Property.create("parent", IvConcrete.class);
 
+    protected String name;
+
+    protected Object children;
+    protected Object parent;
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
     public void addToChildren(IvConcrete obj) {
         addToManyTarget("children", obj, true);
     }
+
     public void removeFromChildren(IvConcrete obj) {
         removeToManyTarget("children", obj, true);
     }
+
     @SuppressWarnings("unchecked")
     public List<IvConcrete> getChildren() {
         return (List<IvConcrete>)readProperty("children");
     }
 
-
     public void setParent(IvConcrete parent) {
         setToOneTarget("parent", parent, true);
     }
@@ -49,5 +61,67 @@ public abstract class _IvConcrete extends IvAbstract {
         return (IvConcrete)readProperty("parent");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "children":
+                return this.children;
+            case "parent":
+                return this.parent;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "children":
+                this.children = val;
+                break;
+            case "parent":
+                this.parent = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(children);
+        out.writeObject(parent);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        children = in.readObject();
+        parent = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImpl.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImpl.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImpl.java
index a6aee01..b24df08 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImpl.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImpl.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.IvBase;
 import org.apache.cayenne.testdo.inheritance_vertical.IvOther;
@@ -21,18 +25,30 @@ public abstract class _IvImpl extends IvBase {
     public static final Property<IvOther> OTHER1 = Property.create("other1", 
IvOther.class);
     public static final Property<IvOther> OTHER2 = Property.create("other2", 
IvOther.class);
 
+    protected String attr1;
+    protected String attr2;
+
+    protected Object other1;
+    protected Object other2;
+
     public void setAttr1(String attr1) {
-        writeProperty("attr1", attr1);
+        beforePropertyWrite("attr1", this.attr1, attr1);
+        this.attr1 = attr1;
     }
+
     public String getAttr1() {
-        return (String)readProperty("attr1");
+        beforePropertyRead("attr1");
+        return attr1;
     }
 
     public void setAttr2(String attr2) {
-        writeProperty("attr2", attr2);
+        beforePropertyWrite("attr2", this.attr2, attr2);
+        this.attr2 = attr2;
     }
+
     public String getAttr2() {
-        return (String)readProperty("attr2");
+        beforePropertyRead("attr2");
+        return attr2;
     }
 
     public void setOther1(IvOther other1) {
@@ -43,7 +59,6 @@ public abstract class _IvImpl extends IvBase {
         return (IvOther)readProperty("other1");
     }
 
-
     public void setOther2(IvOther other2) {
         setToOneTarget("other2", other2, true);
     }
@@ -52,5 +67,74 @@ public abstract class _IvImpl extends IvBase {
         return (IvOther)readProperty("other2");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "attr1":
+                return this.attr1;
+            case "attr2":
+                return this.attr2;
+            case "other1":
+                return this.other1;
+            case "other2":
+                return this.other2;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "attr1":
+                this.attr1 = (String)val;
+                break;
+            case "attr2":
+                this.attr2 = (String)val;
+                break;
+            case "other1":
+                this.other1 = val;
+                break;
+            case "other2":
+                this.other2 = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(attr1);
+        out.writeObject(attr2);
+        out.writeObject(other1);
+        out.writeObject(other2);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        attr1 = (String)in.readObject();
+        attr2 = (String)in.readObject();
+        other1 = in.readObject();
+        other2 = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImplWithLock.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImplWithLock.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImplWithLock.java
index b6836ea..b72749b 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImplWithLock.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvImplWithLock.java
@@ -1,35 +1,20 @@
-/*****************************************************************
- *   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.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
-import org.apache.cayenne.testdo.inheritance_vertical.IvBase;
+import org.apache.cayenne.testdo.inheritance_vertical.IvBaseWithLock;
 import org.apache.cayenne.testdo.inheritance_vertical.IvOther;
 
 /**
- * Class _IvImpl was generated by Cayenne.
+ * Class _IvImplWithLock 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 _IvImplWithLock extends IvBase {
+public abstract class _IvImplWithLock extends IvBaseWithLock {
 
     private static final long serialVersionUID = 1L; 
 
@@ -38,11 +23,18 @@ public abstract class _IvImplWithLock extends IvBase {
     public static final Property<String> ATTR1 = Property.create("attr1", 
String.class);
     public static final Property<IvOther> OTHER1 = Property.create("other1", 
IvOther.class);
 
+    protected String attr1;
+
+    protected Object other1;
+
     public void setAttr1(String attr1) {
-        writeProperty("attr1", attr1);
+        beforePropertyWrite("attr1", this.attr1, attr1);
+        this.attr1 = attr1;
     }
+
     public String getAttr1() {
-        return (String)readProperty("attr1");
+        beforePropertyRead("attr1");
+        return attr1;
     }
 
     public void setOther1(IvOther other1) {
@@ -53,5 +45,60 @@ public abstract class _IvImplWithLock extends IvBase {
         return (IvOther)readProperty("other1");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "attr1":
+                return this.attr1;
+            case "other1":
+                return this.other1;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "attr1":
+                this.attr1 = (String)val;
+                break;
+            case "other1":
+                this.other1 = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(attr1);
+        out.writeObject(other1);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        attr1 = (String)in.readObject();
+        other1 = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvOther.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvOther.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvOther.java
index d3f9aa2..0554293 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvOther.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvOther.java
@@ -1,19 +1,22 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.List;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.IvImpl;
 import org.apache.cayenne.testdo.inheritance_vertical.IvImplWithLock;
 
-import java.util.List;
-
 /**
  * Class _IvOther 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 _IvOther extends CayenneDataObject {
+public abstract class _IvOther extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -23,34 +26,92 @@ public abstract class _IvOther extends CayenneDataObject {
     public static final Property<List<IvImpl>> IMPLS = 
Property.create("impls", List.class);
     public static final Property<List<IvImplWithLock>> IMPLS_WITH_LOCK = 
Property.create("implsWithLock", List.class);
 
+    protected String name;
+
+    protected Object impls;
+    protected Object implsWithLock;
+
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
     }
 
-    public void addToImpls(IvImpl obj) {
-        addToManyTarget("impls", obj, true);
-    }
-    public void removeFromImpls(IvImpl obj) {
-        removeToManyTarget("impls", obj, true);
-    }
     @SuppressWarnings("unchecked")
     public List<IvImpl> getImpls() {
         return (List<IvImpl>)readProperty("impls");
     }
 
-    public void addToImplsWithLock(IvImplWithLock obj) {
-        addToManyTarget("implsWithLock", obj, true);
-    }
-    public void removeFromImplsWithLock(IvImplWithLock obj) {
-        removeToManyTarget("implsWithLock", obj, true);
-    }
     @SuppressWarnings("unchecked")
     public List<IvImplWithLock> getImplsWithLock() {
         return (List<IvImplWithLock>)readProperty("implsWithLock");
     }
 
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "name":
+                return this.name;
+            case "impls":
+                return this.impls;
+            case "implsWithLock":
+                return this.implsWithLock;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "name":
+                this.name = (String)val;
+                break;
+            case "impls":
+                this.impls = val;
+                break;
+            case "implsWithLock":
+                this.implsWithLock = val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(name);
+        out.writeObject(impls);
+        out.writeObject(implsWithLock);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        name = (String)in.readObject();
+        impls = in.readObject();
+        implsWithLock = in.readObject();
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvRoot.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvRoot.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvRoot.java
index 68f0488..b88346b 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvRoot.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvRoot.java
@@ -1,6 +1,10 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
-import org.apache.cayenne.CayenneDataObject;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.apache.cayenne.BaseDataObject;
 import org.apache.cayenne.exp.Property;
 
 /**
@@ -9,7 +13,7 @@ import org.apache.cayenne.exp.Property;
  * since it may be overwritten next time code is regenerated.
  * If you need to make any customizations, please use subclass.
  */
-public abstract class _IvRoot extends CayenneDataObject {
+public abstract class _IvRoot extends BaseDataObject {
 
     private static final long serialVersionUID = 1L; 
 
@@ -18,18 +22,84 @@ public abstract class _IvRoot extends CayenneDataObject {
     public static final Property<String> DISCRIMINATOR = 
Property.create("discriminator", String.class);
     public static final Property<String> NAME = Property.create("name", 
String.class);
 
+    protected String discriminator;
+    protected String name;
+
+
     public void setDiscriminator(String discriminator) {
-        writeProperty("discriminator", discriminator);
+        beforePropertyWrite("discriminator", this.discriminator, 
discriminator);
+        this.discriminator = discriminator;
     }
+
     public String getDiscriminator() {
-        return (String)readProperty("discriminator");
+        beforePropertyRead("discriminator");
+        return discriminator;
     }
 
     public void setName(String name) {
-        writeProperty("name", name);
+        beforePropertyWrite("name", this.name, name);
+        this.name = name;
     }
+
     public String getName() {
-        return (String)readProperty("name");
+        beforePropertyRead("name");
+        return name;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "discriminator":
+                return this.discriminator;
+            case "name":
+                return this.name;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "discriminator":
+                this.discriminator = (String)val;
+                break;
+            case "name":
+                this.name = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(discriminator);
+        out.writeObject(name);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        discriminator = (String)in.readObject();
+        name = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1.java
index 8d21cd7..3dc23bb 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.IvRoot;
 
@@ -17,11 +21,66 @@ public abstract class _IvSub1 extends IvRoot {
 
     public static final Property<String> SUB1NAME = 
Property.create("sub1Name", String.class);
 
+    protected String sub1Name;
+
+
     public void setSub1Name(String sub1Name) {
-        writeProperty("sub1Name", sub1Name);
+        beforePropertyWrite("sub1Name", this.sub1Name, sub1Name);
+        this.sub1Name = sub1Name;
     }
+
     public String getSub1Name() {
-        return (String)readProperty("sub1Name");
+        beforePropertyRead("sub1Name");
+        return sub1Name;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "sub1Name":
+                return this.sub1Name;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "sub1Name":
+                this.sub1Name = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(sub1Name);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        sub1Name = (String)in.readObject();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/544aae08/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1Sub1.java
----------------------------------------------------------------------
diff --git 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1Sub1.java
 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1Sub1.java
index f4ebb4d..83e36f4 100644
--- 
a/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1Sub1.java
+++ 
b/cayenne-server/src/test/java/org/apache/cayenne/testdo/inheritance_vertical/auto/_IvSub1Sub1.java
@@ -1,5 +1,9 @@
 package org.apache.cayenne.testdo.inheritance_vertical.auto;
 
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
 import org.apache.cayenne.exp.Property;
 import org.apache.cayenne.testdo.inheritance_vertical.IvSub1;
 
@@ -17,11 +21,66 @@ public abstract class _IvSub1Sub1 extends IvSub1 {
 
     public static final Property<String> SUB1SUB1NAME = 
Property.create("sub1Sub1Name", String.class);
 
+    protected String sub1Sub1Name;
+
+
     public void setSub1Sub1Name(String sub1Sub1Name) {
-        writeProperty("sub1Sub1Name", sub1Sub1Name);
+        beforePropertyWrite("sub1Sub1Name", this.sub1Sub1Name, sub1Sub1Name);
+        this.sub1Sub1Name = sub1Sub1Name;
     }
+
     public String getSub1Sub1Name() {
-        return (String)readProperty("sub1Sub1Name");
+        beforePropertyRead("sub1Sub1Name");
+        return sub1Sub1Name;
+    }
+
+    @Override
+    public Object readPropertyDirectly(String propName) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch(propName) {
+            case "sub1Sub1Name":
+                return this.sub1Sub1Name;
+            default:
+                return super.readPropertyDirectly(propName);
+        }
+    }
+
+    @Override
+    public void writePropertyDirectly(String propName, Object val) {
+        if(propName == null) {
+            throw new IllegalArgumentException();
+        }
+
+        switch (propName) {
+            case "sub1Sub1Name":
+                this.sub1Sub1Name = (String)val;
+                break;
+            default:
+                super.writePropertyDirectly(propName, val);
+        }
+    }
+
+    private void writeObject(ObjectOutputStream out) throws IOException {
+        writeSerialized(out);
+    }
+
+    private void readObject(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        readSerialized(in);
+    }
+
+    @Override
+    protected void writeState(ObjectOutputStream out) throws IOException {
+        super.writeState(out);
+        out.writeObject(sub1Sub1Name);
+    }
+
+    @Override
+    protected void readState(ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        super.readState(in);
+        sub1Sub1Name = (String)in.readObject();
     }
 
 }

Reply via email to