Use columnNameToProperty to look up property names for columns

instead of doing it myself. DbMapping does takes care to make the
lookup case insensitive.
This commit is contained in:
hns 2002-03-26 15:16:58 +00:00
parent 0ec0e17485
commit d13d2087f4

View file

@ -247,7 +247,7 @@ public final class Node implements INode, Serializable {
created = lastmodified = System.currentTimeMillis (); created = lastmodified = System.currentTimeMillis ();
for (Iterator i=dbmap.getDB2Prop().values().iterator(); i.hasNext(); ) { for (Iterator i=dbmap.getDBPropertyIterator(); i.hasNext(); ) {
Relation rel = (Relation) i.next (); Relation rel = (Relation) i.next ();
// NOTE: this should never be the case, since we're just looping through // NOTE: this should never be the case, since we're just looping through
@ -605,7 +605,7 @@ public final class Node implements INode, Serializable {
Relation prel = parentmap.getPropertyRelation (); Relation prel = parentmap.getPropertyRelation ();
if (prel != null && prel.otherType == dbmap && prel.accessor != null) { if (prel != null && prel.otherType == dbmap && prel.accessor != null) {
// reverse look up property used to access this via parent // reverse look up property used to access this via parent
Relation proprel = (Relation) dbmap.getDB2Prop ().get (prel.accessor); Relation proprel = dbmap.columnNameToRelation (prel.accessor);
if (proprel != null && proprel.propName != null) if (proprel != null && proprel.propName != null)
newname = getString (proprel.propName, false); newname = getString (proprel.propName, false);
} }
@ -657,7 +657,7 @@ public final class Node implements INode, Serializable {
try { try {
if (dbm != null && dbm.getSubnodeGroupby () != null) { if (dbm != null && dbm.getSubnodeGroupby () != null) {
// check for groupby // check for groupby
rel = (Relation) dbmap.getDB2Prop ().get (dbm.getSubnodeGroupby()); rel = dbmap.columnNameToRelation (dbm.getSubnodeGroupby());
pn = pn.getSubnode (getString (rel.propName, false)); pn = pn.getSubnode (getString (rel.propName, false));
} }
if (pn != null) { if (pn != null) {
@ -735,7 +735,7 @@ public final class Node implements INode, Serializable {
if (dbmap != null) { if (dbmap != null) {
Relation srel = dbmap.getSubnodeRelation (); Relation srel = dbmap.getSubnodeRelation ();
if (srel != null && srel.groupby != null) try { if (srel != null && srel.groupby != null) try {
Relation groupbyRel = (Relation) srel.otherType.getDB2Prop ().get (srel.groupby); Relation groupbyRel = srel.otherType.columnNameToRelation (srel.groupby);
String groupbyProp = (groupbyRel != null) ? String groupbyProp = (groupbyRel != null) ?
groupbyRel.propName : srel.groupby; groupbyRel.propName : srel.groupby;
String groupbyValue = node.getString (groupbyProp, false); String groupbyValue = node.getString (groupbyProp, false);