content: package org.apache.cayenne.testdo.relationships_many_to_many_join.auto;
  
  import java.io.IOException;
  import java.io.ObjectInputStream;
  import java.io.ObjectOutputStream;
  import java.util.List;
  
  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.testdo.relationships_many_to_many_join.SelfRelationship;
  import org.apache.cayenne.testdo.relationships_many_to_many_join.SelfRelationshipSub;
  
  /**
   * Class _SelfRelationshipSub 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 _SelfRelationshipSub extends SelfRelationship {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<SelfRelationshipSub> SELF = PropertyFactory.createSelf(SelfRelationshipSub.class);
  
      public static final NumericIdProperty<Integer> SELF_ID_PK_PROPERTY = PropertyFactory.createNumericId("SELF_ID", "SelfRelationshipSub", Integer.class);
      public static final String SELF_ID_PK_COLUMN = "SELF_ID";
  
      public static final ListProperty<SelfRelationship> SELF_PARENTS = PropertyFactory.createList("selfParents", SelfRelationship.class);
  
  
      protected Object selfParents;
  
      public void addToSelfParents(SelfRelationship obj) {
          addToManyTarget("selfParents", obj, true);
      }
  
      public void removeFromSelfParents(SelfRelationship obj) {
          removeToManyTarget("selfParents", obj, true);
      }
  
      @SuppressWarnings("unchecked")
      public List<SelfRelationship> getSelfParents() {
          return (List<SelfRelationship>)readProperty("selfParents");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "selfParents":
                  return this.selfParents;
              default:
                  return super.readPropertyDirectly(propName);
          }
      }
  
      @Override
      public void writePropertyDirectly(String propName, Object val) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch (propName) {
              case "selfParents":
                  this.selfParents = 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.selfParents);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.selfParents = in.readObject();
      }
  
  }
  