Every DbMapping object must now have a reference to the
application it belongs to.
This commit is contained in:
parent
ef5b901c1e
commit
a8fd428530
1 changed files with 6 additions and 4 deletions
|
@ -88,7 +88,9 @@ public class DbMapping implements Updatable {
|
||||||
/**
|
/**
|
||||||
* Create an empty DbMapping
|
* Create an empty DbMapping
|
||||||
*/
|
*/
|
||||||
public DbMapping () {
|
public DbMapping (Application app) {
|
||||||
|
|
||||||
|
this.app = app;
|
||||||
|
|
||||||
prop2db = new Hashtable ();
|
prop2db = new Hashtable ();
|
||||||
db2prop = new Hashtable ();
|
db2prop = new Hashtable ();
|
||||||
|
@ -471,7 +473,7 @@ public class DbMapping implements Updatable {
|
||||||
if (parentMapping != null)
|
if (parentMapping != null)
|
||||||
return parentMapping.getPropertyMapping (null);
|
return parentMapping.getPropertyMapping (null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Relation rel = (Relation) prop2db.get (propname.toLowerCase());
|
Relation rel = (Relation) prop2db.get (propname.toLowerCase());
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
// if this is a virtual node, it doesn't have a dbmapping
|
// if this is a virtual node, it doesn't have a dbmapping
|
||||||
|
@ -480,7 +482,7 @@ public class DbMapping implements Updatable {
|
||||||
else
|
else
|
||||||
return rel.otherType;
|
return rel.otherType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (propertiesRel != null)
|
if (propertiesRel != null)
|
||||||
return propertiesRel.otherType;
|
return propertiesRel.otherType;
|
||||||
if (parentMapping != null)
|
if (parentMapping != null)
|
||||||
|
@ -502,7 +504,7 @@ public class DbMapping implements Updatable {
|
||||||
groupbyMapping = app.getDbMapping (subnodesRel.groupbyprototype);
|
groupbyMapping = app.getDbMapping (subnodesRel.groupbyprototype);
|
||||||
// if mapping doesn' exist or isn't defined, create a new (anonymous internal) one
|
// if mapping doesn' exist or isn't defined, create a new (anonymous internal) one
|
||||||
if (groupbyMapping == null)
|
if (groupbyMapping == null)
|
||||||
groupbyMapping = new DbMapping ();
|
groupbyMapping = new DbMapping (app);
|
||||||
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