initial commit

This commit is contained in:
2022-01-05 22:47:13 -05:00
commit 2393a392da
34 changed files with 1055 additions and 0 deletions

View File

@ -0,0 +1,9 @@
package test.cayenne;
import test.cayenne.auto._E1;
public class E1 extends _E1 {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,9 @@
package test.cayenne;
import test.cayenne.auto._E2;
public class E2 extends _E2 {
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,131 @@
package test.cayenne.auto;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import org.apache.cayenne.BaseDataObject;
import org.apache.cayenne.exp.property.EntityProperty;
import org.apache.cayenne.exp.property.ListProperty;
import org.apache.cayenne.exp.property.PropertyFactory;
import org.apache.cayenne.exp.property.StringProperty;
import test.cayenne.E2;
/**
* Class _E1 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 _E1 extends BaseDataObject {
private static final long serialVersionUID = 1L;
public static final String ID_PK_COLUMN = "id";
public static final StringProperty<String> TEXT = PropertyFactory.createString("text", String.class);
public static final EntityProperty<E2> E2 = PropertyFactory.createEntity("e2", E2.class);
public static final ListProperty<E2> E2S = PropertyFactory.createList("e2s", E2.class);
protected String text;
protected Object e2;
protected Object e2s;
public void setText(String text) {
beforePropertyWrite("text", this.text, text);
this.text = text;
}
public String getText() {
beforePropertyRead("text");
return this.text;
}
public void setE2(E2 e2) {
setToOneTarget("e2", e2, true);
}
public E2 getE2() {
return (E2)readProperty("e2");
}
public void addToE2s(E2 obj) {
addToManyTarget("e2s", obj, true);
}
public void removeFromE2s(E2 obj) {
removeToManyTarget("e2s", obj, true);
}
@SuppressWarnings("unchecked")
public List<E2> getE2s() {
return (List<E2>)readProperty("e2s");
}
@Override
public Object readPropertyDirectly(String propName) {
if(propName == null) {
throw new IllegalArgumentException();
}
switch(propName) {
case "text":
return this.text;
case "e2":
return this.e2;
case "e2s":
return this.e2s;
default:
return super.readPropertyDirectly(propName);
}
}
@Override
public void writePropertyDirectly(String propName, Object val) {
if(propName == null) {
throw new IllegalArgumentException();
}
switch (propName) {
case "text":
this.text = (String)val;
break;
case "e2":
this.e2 = val;
break;
case "e2s":
this.e2s = 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.text);
out.writeObject(this.e2);
out.writeObject(this.e2s);
}
@Override
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
super.readState(in);
this.text = (String)in.readObject();
this.e2 = in.readObject();
this.e2s = in.readObject();
}
}

View File

@ -0,0 +1,131 @@
package test.cayenne.auto;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import org.apache.cayenne.BaseDataObject;
import org.apache.cayenne.exp.property.EntityProperty;
import org.apache.cayenne.exp.property.ListProperty;
import org.apache.cayenne.exp.property.PropertyFactory;
import org.apache.cayenne.exp.property.StringProperty;
import test.cayenne.E1;
/**
* Class _E2 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 _E2 extends BaseDataObject {
private static final long serialVersionUID = 1L;
public static final String ID_PK_COLUMN = "id";
public static final StringProperty<String> TEXT = PropertyFactory.createString("text", String.class);
public static final EntityProperty<E1> E1 = PropertyFactory.createEntity("e1", E1.class);
public static final ListProperty<E1> E1S = PropertyFactory.createList("e1s", E1.class);
protected String text;
protected Object e1;
protected Object e1s;
public void setText(String text) {
beforePropertyWrite("text", this.text, text);
this.text = text;
}
public String getText() {
beforePropertyRead("text");
return this.text;
}
public void setE1(E1 e1) {
setToOneTarget("e1", e1, true);
}
public E1 getE1() {
return (E1)readProperty("e1");
}
public void addToE1s(E1 obj) {
addToManyTarget("e1s", obj, true);
}
public void removeFromE1s(E1 obj) {
removeToManyTarget("e1s", obj, true);
}
@SuppressWarnings("unchecked")
public List<E1> getE1s() {
return (List<E1>)readProperty("e1s");
}
@Override
public Object readPropertyDirectly(String propName) {
if(propName == null) {
throw new IllegalArgumentException();
}
switch(propName) {
case "text":
return this.text;
case "e1":
return this.e1;
case "e1s":
return this.e1s;
default:
return super.readPropertyDirectly(propName);
}
}
@Override
public void writePropertyDirectly(String propName, Object val) {
if(propName == null) {
throw new IllegalArgumentException();
}
switch (propName) {
case "text":
this.text = (String)val;
break;
case "e1":
this.e1 = val;
break;
case "e1s":
this.e1s = 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.text);
out.writeObject(this.e1);
out.writeObject(this.e1s);
}
@Override
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException {
super.readState(in);
this.text = (String)in.readObject();
this.e1 = in.readObject();
this.e1s = in.readObject();
}
}