-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GET with includes can't match children to parent when parent has a c…
…ompound key #684
- Loading branch information
Showing
9 changed files
with
312 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
agrest-cayenne/src/test/java/io/agrest/cayenne/cayenne/main/E32.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.agrest.cayenne.cayenne.main; | ||
|
||
import io.agrest.cayenne.cayenne.main.auto._E32; | ||
|
||
public class E32 extends _E32 { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
agrest-cayenne/src/test/java/io/agrest/cayenne/cayenne/main/E33.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package io.agrest.cayenne.cayenne.main; | ||
|
||
import io.agrest.cayenne.cayenne.main.auto._E33; | ||
|
||
public class E33 extends _E33 { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
} |
109 changes: 109 additions & 0 deletions
109
agrest-cayenne/src/test/java/io/agrest/cayenne/cayenne/main/auto/_E32.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package io.agrest.cayenne.cayenne.main.auto; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
|
||
import org.apache.cayenne.BaseDataObject; | ||
import org.apache.cayenne.exp.property.EntityProperty; | ||
import org.apache.cayenne.exp.property.PropertyFactory; | ||
import org.apache.cayenne.exp.property.StringProperty; | ||
|
||
import io.agrest.cayenne.cayenne.main.E33; | ||
|
||
/** | ||
* Class _E32 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 _E32 extends BaseDataObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public static final String S_ID_PK_COLUMN = "s_id"; | ||
public static final String P_ID_PK_COLUMN = "p_id"; | ||
public static final String T_ID_PK_COLUMN = "t_id"; | ||
|
||
public static final StringProperty<String> NAME = PropertyFactory.createString("name", String.class); | ||
public static final EntityProperty<E33> E33 = PropertyFactory.createEntity("e33", E33.class); | ||
|
||
protected String name; | ||
|
||
protected Object e33; | ||
|
||
public void setName(String name) { | ||
beforePropertyWrite("name", this.name, name); | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
beforePropertyRead("name"); | ||
return this.name; | ||
} | ||
|
||
public void setE33(E33 e33) { | ||
setToOneTarget("e33", e33, true); | ||
} | ||
|
||
public E33 getE33() { | ||
return (E33)readProperty("e33"); | ||
} | ||
|
||
@Override | ||
public Object readPropertyDirectly(String propName) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch(propName) { | ||
case "name": | ||
return this.name; | ||
case "e33": | ||
return this.e33; | ||
default: | ||
return super.readPropertyDirectly(propName); | ||
} | ||
} | ||
|
||
@Override | ||
public void writePropertyDirectly(String propName, Object val) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch (propName) { | ||
case "name": | ||
this.name = (String)val; | ||
break; | ||
case "e33": | ||
this.e33 = 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.name); | ||
out.writeObject(this.e33); | ||
} | ||
|
||
@Override | ||
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
super.readState(in); | ||
this.name = (String)in.readObject(); | ||
this.e33 = in.readObject(); | ||
} | ||
|
||
} |
87 changes: 87 additions & 0 deletions
87
agrest-cayenne/src/test/java/io/agrest/cayenne/cayenne/main/auto/_E33.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
package io.agrest.cayenne.cayenne.main.auto; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
|
||
import org.apache.cayenne.BaseDataObject; | ||
import org.apache.cayenne.exp.property.PropertyFactory; | ||
import org.apache.cayenne.exp.property.StringProperty; | ||
|
||
/** | ||
* Class _E33 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 _E33 extends BaseDataObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public static final String P_ID_PK_COLUMN = "p_id"; | ||
|
||
public static final StringProperty<String> NAME = PropertyFactory.createString("name", String.class); | ||
|
||
protected String name; | ||
|
||
|
||
public void setName(String name) { | ||
beforePropertyWrite("name", this.name, name); | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
beforePropertyRead("name"); | ||
return this.name; | ||
} | ||
|
||
@Override | ||
public Object readPropertyDirectly(String propName) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch(propName) { | ||
case "name": | ||
return this.name; | ||
default: | ||
return super.readPropertyDirectly(propName); | ||
} | ||
} | ||
|
||
@Override | ||
public void writePropertyDirectly(String propName, Object val) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch (propName) { | ||
case "name": | ||
this.name = (String)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.name); | ||
} | ||
|
||
@Override | ||
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
super.readState(in); | ||
this.name = (String)in.readObject(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.