content: package org.apache.cayenne.testdo.binary_pk.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  
  import org.apache.cayenne.PersistentObject;
  import org.apache.cayenne.exp.property.EntityProperty;
  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.binary_pk.BinaryPKTest1;
  import org.apache.cayenne.testdo.binary_pk.BinaryPKTest2;
  
  /**
   * Class _BinaryPKTest2 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 _BinaryPKTest2 extends PersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<BinaryPKTest2> SELF = PropertyFactory.createSelf(BinaryPKTest2.class);
  
      public static final NumericIdProperty<Integer> ID_PK_PROPERTY = PropertyFactory.createNumericId("ID", "BinaryPKTest2", Integer.class);
      public static final String ID_PK_COLUMN = "ID";
  
      public static final StringProperty<String> DETAIL_NAME = PropertyFactory.createString("detailName", String.class);
      public static final EntityProperty<BinaryPKTest1> TO_BINARY_PKMASTER = PropertyFactory.createEntity("toBinaryPKMaster", BinaryPKTest1.class);
  
      protected String detailName;
  
      protected Object toBinaryPKMaster;
  
      public void setDetailName(String detailName) {
          beforePropertyWrite("detailName", this.detailName, detailName);
          this.detailName = detailName;
      }
  
      public String getDetailName() {
          beforePropertyRead("detailName");
          return this.detailName;
      }
  
      public void setToBinaryPKMaster(BinaryPKTest1 toBinaryPKMaster) {
          setToOneTarget("toBinaryPKMaster", toBinaryPKMaster, true);
      }
  
      public BinaryPKTest1 getToBinaryPKMaster() {
          return (BinaryPKTest1)readProperty("toBinaryPKMaster");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "detailName":
                  return this.detailName;
              case "toBinaryPKMaster":
                  return this.toBinaryPKMaster;
              default:
                  return super.readPropertyDirectly(propName);
          }
      }
  
      @Override
      public void writePropertyDirectly(String propName, Object val) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch (propName) {
              case "detailName":
                  this.detailName = (String)val;
                  break;
              case "toBinaryPKMaster":
                  this.toBinaryPKMaster = 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.detailName);
          out.writeObject(this.toBinaryPKMaster);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.detailName = (String)in.readObject();
          this.toBinaryPKMaster = in.readObject();
      }
  
  }
  