if a prototype if specified for groupby nodes, use the DbMapping
parsed by the application instead of creating a vanilla DbMapping. This makes it possible to actually define additional properties and collections on groupby nodes.
This commit is contained in:
parent
deca565254
commit
f13c73a5d1
1 changed files with 7 additions and 1 deletions
|
@ -496,7 +496,13 @@ public class DbMapping implements Updatable {
|
||||||
if (subnodesRel == null || subnodesRel.groupby == null)
|
if (subnodesRel == null || subnodesRel.groupby == null)
|
||||||
return null;
|
return null;
|
||||||
if (groupbyMapping == null) {
|
if (groupbyMapping == null) {
|
||||||
groupbyMapping = new DbMapping ();
|
// if a prototype is defined for groupby nodes, use that
|
||||||
|
// DbMapping instead of creating a new one
|
||||||
|
if (subnodesRel.groupbyprototype != null)
|
||||||
|
groupbyMapping = app.getDbMapping (subnodesRel.groupbyprototype);
|
||||||
|
// if mapping doesn' exist or isn't defined, create a new (anonymous internal) one
|
||||||
|
if (groupbyMapping == null)
|
||||||
|
groupbyMapping = new DbMapping ();
|
||||||
groupbyMapping.subnodesRel = subnodesRel.getGroupbySubnodeRelation ();
|
groupbyMapping.subnodesRel = subnodesRel.getGroupbySubnodeRelation ();
|
||||||
if (propertiesRel != null)
|
if (propertiesRel != null)
|
||||||
groupbyMapping.propertiesRel = propertiesRel.getGroupbyPropertyRelation ();
|
groupbyMapping.propertiesRel = propertiesRel.getGroupbyPropertyRelation ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue