content: package org.apache.cayenne.testdo.things.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  
  import org.apache.cayenne.GenericPersistentObject;
  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.things.Box;
  import org.apache.cayenne.testdo.things.BoxInfo;
  
  /**
   * Class _BoxInfo 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 _BoxInfo extends GenericPersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<BoxInfo> SELF = PropertyFactory.createSelf(BoxInfo.class);
  
      public static final NumericIdProperty<Long> ID_PK_PROPERTY = PropertyFactory.createNumericId("ID", "BoxInfo", Long.class);
      public static final String ID_PK_COLUMN = "ID";
  
      public static final StringProperty<String> COLOR = PropertyFactory.createString("color", String.class);
      public static final EntityProperty<Box> BOX = PropertyFactory.createEntity("box", Box.class);
  
      protected String color;
  
      protected Object box;
  
      public void setColor(String color) {
          beforePropertyWrite("color", this.color, color);
          this.color = color;
      }
  
      public String getColor() {
          beforePropertyRead("color");
          return this.color;
      }
  
      public void setBox(Box box) {
          setToOneTarget("box", box, true);
      }
  
      public Box getBox() {
          return (Box)readProperty("box");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "color":
                  return this.color;
              case "box":
                  return this.box;
              default:
                  return super.readPropertyDirectly(propName);
          }
      }
  
      @Override
      public void writePropertyDirectly(String propName, Object val) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch (propName) {
              case "color":
                  this.color = (String)val;
                  break;
              case "box":
                  this.box = 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.color);
          out.writeObject(this.box);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.color = (String)in.readObject();
          this.box = in.readObject();
      }
  
  }
  