content: package org.apache.cayenne.testdo.testmap.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.testdo.testmap.Artist;
  import org.apache.cayenne.testdo.testmap.ArtistExhibit;
  import org.apache.cayenne.testdo.testmap.Exhibit;
  
  /**
   * Class _ArtistExhibit 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 _ArtistExhibit extends PersistentObject {
  
      private static final long serialVersionUID = 1L;
  
      public static final SelfProperty<ArtistExhibit> SELF = PropertyFactory.createSelf(ArtistExhibit.class);
  
      public static final NumericIdProperty<Long> ARTIST_ID_PK_PROPERTY = PropertyFactory.createNumericId("ARTIST_ID", "ArtistExhibit", Long.class);
      public static final String ARTIST_ID_PK_COLUMN = "ARTIST_ID";
      public static final NumericIdProperty<Integer> EXHIBIT_ID_PK_PROPERTY = PropertyFactory.createNumericId("EXHIBIT_ID", "ArtistExhibit", Integer.class);
      public static final String EXHIBIT_ID_PK_COLUMN = "EXHIBIT_ID";
  
      public static final EntityProperty<Artist> TO_ARTIST = PropertyFactory.createEntity("toArtist", Artist.class);
      public static final EntityProperty<Exhibit> TO_EXHIBIT = PropertyFactory.createEntity("toExhibit", Exhibit.class);
  
  
      protected Object toArtist;
      protected Object toExhibit;
  
      public void setToArtist(Artist toArtist) {
          setToOneTarget("toArtist", toArtist, true);
      }
  
      public Artist getToArtist() {
          return (Artist)readProperty("toArtist");
      }
  
      public void setToExhibit(Exhibit toExhibit) {
          setToOneTarget("toExhibit", toExhibit, true);
      }
  
      public Exhibit getToExhibit() {
          return (Exhibit)readProperty("toExhibit");
      }
  
      @Override
      public Object readPropertyDirectly(String propName) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch(propName) {
              case "toArtist":
                  return this.toArtist;
              case "toExhibit":
                  return this.toExhibit;
              default:
                  return super.readPropertyDirectly(propName);
          }
      }
  
      @Override
      public void writePropertyDirectly(String propName, Object val) {
          if(propName == null) {
              throw new IllegalArgumentException();
          }
  
          switch (propName) {
              case "toArtist":
                  this.toArtist = val;
                  break;
              case "toExhibit":
                  this.toExhibit = 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.toArtist);
          out.writeObject(this.toExhibit);
      }
  
      @Override
      protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
          super.readState(in);
          this.toArtist = in.readObject();
          this.toExhibit = in.readObject();
      }
  
  }
  