content: package org.apache.cayenne.testdo.compound.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  
  import org.apache.cayenne.PersistentObject;
  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.compound.CompoundIntPk;
  
  /**
   * Class _CompoundIntPk 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 _CompoundIntPk extends PersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<CompoundIntPk> SELF = PropertyFactory.createSelf(CompoundIntPk.class);
  
      public static final String ID1_PK_COLUMN = "id1";
      public static final String ID2_PK_COLUMN = "id2";
  
      public static final NumericProperty<Integer> ID1 = PropertyFactory.createNumeric("id1", Integer.class);
      public static final NumericProperty<Integer> ID2 = PropertyFactory.createNumeric("id2", Integer.class);
      public static final StringProperty<String> NAME = PropertyFactory.createString("name", String.class);
  
      protected Integer id1;
      protected Integer id2;
      protected String name;
  
  
      public void setId1(Integer id1) {
          beforePropertyWrite("id1", this.id1, id1);
          this.id1 = id1;
      }
  
      public Integer getId1() {
          beforePropertyRead("id1");
          return this.id1;
      }
  
      public void setId2(Integer id2) {
          beforePropertyWrite("id2", this.id2, id2);
          this.id2 = id2;
      }
  
      public Integer getId2() {
          beforePropertyRead("id2");
          return this.id2;
      }
  
      public void setName(String name) {
          beforePropertyWrite("name", this.name, name);
          this.name = name;
      }
  
      public String getName() {
          beforePropertyRead("name");
          return this.name;
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "id1":
                  return this.id1;
              case "id2":
                  return this.id2;
              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 "id1":
                  this.id1 = (Integer)val;
                  break;
              case "id2":
                  this.id2 = (Integer)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(this.id1);
          out.writeObject(this.id2);
          out.writeObject(this.name);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.id1 = (Integer)in.readObject();
          this.id2 = (Integer)in.readObject();
          this.name = (String)in.readObject();
      }
  
  }
  