Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CAY-2389 DbEntity qualifier with DbPath expression translates into wr…
…ong SQL
- Loading branch information
Showing
9 changed files
with
333 additions
and
17 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
cayenne-server/src/test/java/org/apache/cayenne/testdo/qualified/Qualified3.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 org.apache.cayenne.testdo.qualified; | ||
|
||
import org.apache.cayenne.testdo.qualified.auto._Qualified3; | ||
|
||
public class Qualified3 extends _Qualified3 { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
cayenne-server/src/test/java/org/apache/cayenne/testdo/qualified/Qualified4.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 org.apache.cayenne.testdo.qualified; | ||
|
||
import org.apache.cayenne.testdo.qualified.auto._Qualified4; | ||
|
||
public class Qualified4 extends _Qualified4 { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
} |
110 changes: 110 additions & 0 deletions
110
cayenne-server/src/test/java/org/apache/cayenne/testdo/qualified/auto/_Qualified3.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,110 @@ | ||
package org.apache.cayenne.testdo.qualified.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; | ||
import org.apache.cayenne.testdo.qualified.Qualified4; | ||
|
||
/** | ||
* Class _Qualified3 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 _Qualified3 extends BaseDataObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public static final String ID_PK_COLUMN = "ID"; | ||
|
||
public static final Property<String> NAME = Property.create("name", String.class); | ||
public static final Property<List<Qualified4>> QUALIFIED4S = Property.create("qualified4s", List.class); | ||
|
||
protected String name; | ||
|
||
protected Object qualified4s; | ||
|
||
public void setName(String name) { | ||
beforePropertyWrite("name", this.name, name); | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
beforePropertyRead("name"); | ||
return this.name; | ||
} | ||
|
||
public void addToQualified4s(Qualified4 obj) { | ||
addToManyTarget("qualified4s", obj, true); | ||
} | ||
|
||
public void removeFromQualified4s(Qualified4 obj) { | ||
removeToManyTarget("qualified4s", obj, true); | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public List<Qualified4> getQualified4s() { | ||
return (List<Qualified4>)readProperty("qualified4s"); | ||
} | ||
|
||
@Override | ||
public Object readPropertyDirectly(String propName) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch(propName) { | ||
case "name": | ||
return this.name; | ||
case "qualified4s": | ||
return this.qualified4s; | ||
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 "qualified4s": | ||
this.qualified4s = 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.qualified4s); | ||
} | ||
|
||
@Override | ||
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
super.readState(in); | ||
this.name = (String)in.readObject(); | ||
this.qualified4s = in.readObject(); | ||
} | ||
|
||
} |
104 changes: 104 additions & 0 deletions
104
cayenne-server/src/test/java/org/apache/cayenne/testdo/qualified/auto/_Qualified4.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,104 @@ | ||
package org.apache.cayenne.testdo.qualified.auto; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
|
||
import org.apache.cayenne.BaseDataObject; | ||
import org.apache.cayenne.exp.Property; | ||
import org.apache.cayenne.testdo.qualified.Qualified3; | ||
|
||
/** | ||
* Class _Qualified4 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 _Qualified4 extends BaseDataObject { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public static final String ID_PK_COLUMN = "ID"; | ||
|
||
public static final Property<String> NAME = Property.create("name", String.class); | ||
public static final Property<Qualified3> QUALIFIED3 = Property.create("qualified3", Qualified3.class); | ||
|
||
protected String name; | ||
|
||
protected Object qualified3; | ||
|
||
public void setName(String name) { | ||
beforePropertyWrite("name", this.name, name); | ||
this.name = name; | ||
} | ||
|
||
public String getName() { | ||
beforePropertyRead("name"); | ||
return this.name; | ||
} | ||
|
||
public void setQualified3(Qualified3 qualified3) { | ||
setToOneTarget("qualified3", qualified3, true); | ||
} | ||
|
||
public Qualified3 getQualified3() { | ||
return (Qualified3)readProperty("qualified3"); | ||
} | ||
|
||
@Override | ||
public Object readPropertyDirectly(String propName) { | ||
if(propName == null) { | ||
throw new IllegalArgumentException(); | ||
} | ||
|
||
switch(propName) { | ||
case "name": | ||
return this.name; | ||
case "qualified3": | ||
return this.qualified3; | ||
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 "qualified3": | ||
this.qualified3 = 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.qualified3); | ||
} | ||
|
||
@Override | ||
protected void readState(ObjectInputStream in) throws IOException, ClassNotFoundException { | ||
super.readState(in); | ||
this.name = (String)in.readObject(); | ||
this.qualified3 = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<domain xmlns="http://cayenne.apache.org/schema/10/domain" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://cayenne.apache.org/schema/10/domain http://cayenne.apache.org/schema/10/domain.xsd" | ||
project-version="10"> | ||
<map name="qualified"/> | ||
</domain> |
Oops, something went wrong.