Make getVirtualMapping() aware of prototyped collections, i.e. the
application's DbMapping is returned instead of a synthetic virtualMapping.
This commit is contained in:
parent
7ed203c8f0
commit
ff95d49d4a
1 changed files with 11 additions and 0 deletions
|
@ -344,9 +344,20 @@ public final class Relation {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a DbMapping to use for virtual aka collection nodes.
|
||||||
|
*/
|
||||||
public DbMapping getVirtualMapping () {
|
public DbMapping getVirtualMapping () {
|
||||||
|
// return null unless this relation describes a virtual/collection node.
|
||||||
if (!virtual)
|
if (!virtual)
|
||||||
return null;
|
return null;
|
||||||
|
// if the collection node is prototyped, return the app's DbMapping
|
||||||
|
// for that prototype
|
||||||
|
if (prototype != null) {
|
||||||
|
return otherType;
|
||||||
|
}
|
||||||
|
// create a synthetic DbMapping that describes how to fetch the
|
||||||
|
// collection's child objects.
|
||||||
if (virtualMapping == null) {
|
if (virtualMapping == null) {
|
||||||
virtualMapping = new DbMapping (ownType.app);
|
virtualMapping = new DbMapping (ownType.app);
|
||||||
virtualMapping.subRelation = getVirtualSubnodeRelation ();
|
virtualMapping.subRelation = getVirtualSubnodeRelation ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue