content: package org.apache.cayenne.testdo.relationships_flattened.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  import java.util.List;
  
  import org.apache.cayenne.PersistentObject;
  import org.apache.cayenne.exp.property.EntityProperty;
  import org.apache.cayenne.exp.property.ListProperty;
  import org.apache.cayenne.exp.property.NumericIdProperty;
  import org.apache.cayenne.exp.property.PropertyFactory;
  import org.apache.cayenne.exp.property.SelfProperty;
  import org.apache.cayenne.exp.property.StringProperty;
  import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest1;
  import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest2;
  import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest3;
  import org.apache.cayenne.testdo.relationships_flattened.FlattenedTest4;
  
  /**
   * Class _FlattenedTest3 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 _FlattenedTest3 extends PersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<FlattenedTest3> SELF = PropertyFactory.createSelf(FlattenedTest3.class);
  
      public static final NumericIdProperty<Integer> FT3_ID_PK_PROPERTY = PropertyFactory.createNumericId("FT3_ID", "FlattenedTest3", Integer.class);
      public static final String FT3_ID_PK_COLUMN = "FT3_ID";
  
      public static final StringProperty<String> NAME = PropertyFactory.createString("name", String.class);
      public static final ListProperty<FlattenedTest4> FT4ARRAY = PropertyFactory.createList("ft4Array", FlattenedTest4.class);
      public static final EntityProperty<FlattenedTest1> TO_FT1 = PropertyFactory.createEntity("toFT1", FlattenedTest1.class);
      public static final EntityProperty<FlattenedTest2> TO_FT2 = PropertyFactory.createEntity("toFT2", FlattenedTest2.class);
  
      protected String name;
  
      protected Object ft4Array;
      protected Object toFT1;
      protected Object toFT2;
  
      public void setName(String name) {
          beforePropertyWrite("name", this.name, name);
          this.name = name;
      }
  
      public String getName() {
          beforePropertyRead("name");
          return this.name;
      }
  
      public void addToFt4Array(FlattenedTest4 obj) {
          addToManyTarget("ft4Array", obj, true);
      }
  
      public void removeFromFt4Array(FlattenedTest4 obj) {
          removeToManyTarget("ft4Array", obj, true);
      }
  
      @SuppressWarnings("unchecked")
      public List<FlattenedTest4> getFt4Array() {
          return (List<FlattenedTest4>)readProperty("ft4Array");
      }
  
      public void setToFT1(FlattenedTest1 toFT1) {
          setToOneTarget("toFT1", toFT1, true);
      }
  
      public FlattenedTest1 getToFT1() {
          return (FlattenedTest1)readProperty("toFT1");
      }
  
      public void setToFT2(FlattenedTest2 toFT2) {
          setToOneTarget("toFT2", toFT2, true);
      }
  
      public FlattenedTest2 getToFT2() {
          return (FlattenedTest2)readProperty("toFT2");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "name":
                  return this.name;
              case "ft4Array":
                  return this.ft4Array;
              case "toFT1":
                  return this.toFT1;
              case "toFT2":
                  return this.toFT2;
              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 "ft4Array":
                  this.ft4Array = val;
                  break;
              case "toFT1":
                  this.toFT1 = val;
                  break;
              case "toFT2":
                  this.toFT2 = 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(this.name);
          out.writeObject(this.ft4Array);
          out.writeObject(this.toFT1);
          out.writeObject(this.toFT2);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.name = (String)in.readObject();
          this.ft4Array = in.readObject();
          this.toFT1 = in.readObject();
          this.toFT2 = in.readObject();
      }
  
  }
  