|
| 1 | +package org.haiku.haikudepotserver.dataobjects.auto; |
| 2 | + |
| 3 | +import java.io.IOException; |
| 4 | +import java.io.ObjectInputStream; |
| 5 | +import java.io.ObjectOutputStream; |
| 6 | + |
| 7 | +import org.apache.cayenne.exp.Property; |
| 8 | +import org.haiku.haikudepotserver.dataobjects.RepositorySource; |
| 9 | +import org.haiku.haikudepotserver.dataobjects.support.AbstractDataObject; |
| 10 | + |
| 11 | +/** |
| 12 | + * Class _RepositorySourceExtraIdentifier was generated by Cayenne. |
| 13 | + * It is probably a good idea to avoid changing this class manually, |
| 14 | + * since it may be overwritten next time code is regenerated. |
| 15 | + * If you need to make any customizations, please use subclass. |
| 16 | + */ |
| 17 | +public abstract class _RepositorySourceExtraIdentifier extends AbstractDataObject { |
| 18 | + |
| 19 | + private static final long serialVersionUID = 1L; |
| 20 | + |
| 21 | + public static final String ID_PK_COLUMN = "id"; |
| 22 | + |
| 23 | + public static final Property<String> IDENTIFIER = Property.create("identifier", String.class); |
| 24 | + public static final Property<RepositorySource> REPOSITORY_SOURCE = Property.create("repositorySource", RepositorySource.class); |
| 25 | + |
| 26 | + protected String identifier; |
| 27 | + |
| 28 | + protected Object repositorySource; |
| 29 | + |
| 30 | + public void setIdentifier(String identifier) { |
| 31 | + beforePropertyWrite("identifier", this.identifier, identifier); |
| 32 | + this.identifier = identifier; |
| 33 | + } |
| 34 | + |
| 35 | + public String getIdentifier() { |
| 36 | + beforePropertyRead("identifier"); |
| 37 | + return this.identifier; |
| 38 | + } |
| 39 | + |
| 40 | + public void setRepositorySource(RepositorySource repositorySource) { |
| 41 | + setToOneTarget("repositorySource", repositorySource, true); |
| 42 | + } |
| 43 | + |
| 44 | + public RepositorySource getRepositorySource() { |
| 45 | + return (RepositorySource)readProperty("repositorySource"); |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + public Object readPropertyDirectly(String propName) { |
| 50 | + if(propName == null) { |
| 51 | + throw new IllegalArgumentException(); |
| 52 | + } |
| 53 | + |
| 54 | + switch(propName) { |
| 55 | + case "identifier": |
| 56 | + return this.identifier; |
| 57 | + case "repositorySource": |
| 58 | + return this.repositorySource; |
| 59 | + default: |
| 60 | + return super.readPropertyDirectly(propName); |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + @Override |
| 65 | + public void writePropertyDirectly(String propName, Object val) { |
| 66 | + if(propName == null) { |
| 67 | + throw new IllegalArgumentException(); |
| 68 | + } |
| 69 | + |
| 70 | + switch (propName) { |
| 71 | + case "identifier": |
| 72 | + this.identifier = (String)val; |
| 73 | + break; |
| 74 | + case "repositorySource": |
| 75 | + this.repositorySource = val; |
| 76 | + break; |
| 77 | + default: |
| 78 | + super.writePropertyDirectly(propName, val); |
| 79 | + } |
| 80 | + } |
| 81 | + |
| 82 | + private void writeObject(ObjectOutputStream out) throws IOException { |
| 83 | + writeSerialized(out); |
| 84 | + } |
| 85 | + |
| 86 | + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { |
| 87 | + readSerialized(in); |
| 88 | + } |
| 89 | + |
| 90 | + @Override |
| 91 | + protected void writeState(ObjectOutputStream out) throws IOException { |
| 92 | + super.writeState(out); |
| 93 | + out.writeObject(this.identifier); |
| 94 | + out.writeObject(this.repositorySource); |
| 95 | + } |
| 96 | + |
| 97 | + @Override |
| 98 | + protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { |
| 99 | + super.readState(in); |
| 100 | + this.identifier = (String)in.readObject(); |
| 101 | + this.repositorySource = in.readObject(); |
| 102 | + } |
| 103 | + |
| 104 | +} |
0 commit comments