content: package org.apache.cayenne.testdo.hybrid.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  import java.util.List;
  
  import org.apache.cayenne.HybridPersistentObject;
  import org.apache.cayenne.exp.property.ListProperty;
  import org.apache.cayenne.exp.property.NumericIdProperty;
  import org.apache.cayenne.exp.property.NumericProperty;
  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.hybrid.HybridEntity1;
  import org.apache.cayenne.testdo.hybrid.HybridEntity2;
  
  /**
   * Class _HybridEntity1 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 _HybridEntity1 extends HybridPersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<HybridEntity1> SELF = PropertyFactory.createSelf(HybridEntity1.class);
  
      public static final NumericIdProperty<Integer> ID_PK_PROPERTY = PropertyFactory.createNumericId("ID", "HybridEntity1", Integer.class);
      public static final String ID_PK_COLUMN = "ID";
  
      public static final NumericProperty<Integer> INT_FIELD = PropertyFactory.createNumeric("intField", Integer.class);
      public static final StringProperty<String> STR_FIELD = PropertyFactory.createString("strField", String.class);
      public static final ListProperty<HybridEntity2> HYBRID_ENTITIES2 = PropertyFactory.createList("hybridEntities2", HybridEntity2.class);
  
      protected int intField;
      protected String strField;
  
      protected Object hybridEntities2;
  
      public void setIntField(int intField) {
          beforePropertyWrite("intField", this.intField, intField);
          this.intField = intField;
      }
  
      public int getIntField() {
          beforePropertyRead("intField");
          return this.intField;
      }
  
      public void setStrField(String strField) {
          beforePropertyWrite("strField", this.strField, strField);
          this.strField = strField;
      }
  
      public String getStrField() {
          beforePropertyRead("strField");
          return this.strField;
      }
  
      public void addToHybridEntities2(HybridEntity2 obj) {
          addToManyTarget("hybridEntities2", obj, true);
      }
  
      public void removeFromHybridEntities2(HybridEntity2 obj) {
          removeToManyTarget("hybridEntities2", obj, true);
      }
  
      @SuppressWarnings("unchecked")
      public List<HybridEntity2> getHybridEntities2() {
          return (List<HybridEntity2>)readProperty("hybridEntities2");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "intField":
                  return this.intField;
              case "strField":
                  return this.strField;
              case "hybridEntities2":
                  return this.hybridEntities2;
              default:
                  return super.readPropertyDirectly(propName);
          }
      }
  
      @Override
      public void writePropertyDirectly(String propName, Object val) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch (propName) {
              case "intField":
                  this.intField = val == null ? 0 : (int)val;
                  break;
              case "strField":
                  this.strField = (String)val;
                  break;
              case "hybridEntities2":
                  this.hybridEntities2 = 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.writeInt(this.intField);
          out.writeObject(this.strField);
          out.writeObject(this.hybridEntities2);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.intField = in.readInt();
          this.strField = (String)in.readObject();
          this.hybridEntities2 = in.readObject();
      }
  
  }
  