case-sensitivity-switch implemented by kmfdm
This commit is contained in:
parent
a094f59a28
commit
1db31dc405
7 changed files with 89 additions and 38 deletions
|
@ -64,6 +64,9 @@ public final class Application implements Runnable {
|
||||||
// embedded db directory
|
// embedded db directory
|
||||||
File dbDir;
|
File dbDir;
|
||||||
|
|
||||||
|
// false if hopobjects are case sensitive (default)
|
||||||
|
public boolean caseInsensitive;
|
||||||
|
|
||||||
// this application's node manager
|
// this application's node manager
|
||||||
protected NodeManager nmgr;
|
protected NodeManager nmgr;
|
||||||
|
|
||||||
|
@ -224,6 +227,8 @@ public final class Application implements Runnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
||||||
|
this.caseInsensitive = "true".equalsIgnoreCase(server.getAppsProperties(name).getProperty("caseInsensitive"));
|
||||||
|
|
||||||
this.repositories = new ArrayList();
|
this.repositories = new ArrayList();
|
||||||
this.repositories.addAll(Arrays.asList(repositories));
|
this.repositories.addAll(Arrays.asList(repositories));
|
||||||
|
@ -432,7 +437,7 @@ public final class Application implements Runnable {
|
||||||
nmgr.init(dbDir.getAbsoluteFile(), props);
|
nmgr.init(dbDir.getAbsoluteFile(), props);
|
||||||
|
|
||||||
// create the app cache node exposed as app.data
|
// create the app cache node exposed as app.data
|
||||||
cachenode = new TransientNode("app");
|
cachenode = new TransientNode(Application.this, "app");
|
||||||
|
|
||||||
// create and init session manager
|
// create and init session manager
|
||||||
String sessionMgrImpl = props.getProperty("sessionManagerImpl",
|
String sessionMgrImpl = props.getProperty("sessionManagerImpl",
|
||||||
|
@ -1384,6 +1389,19 @@ public final class Application implements Runnable {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the correct property name which is either case sensitive or case insensitive
|
||||||
|
* @param propName the raw property name
|
||||||
|
* @return the correct property name
|
||||||
|
*/
|
||||||
|
public String correctPropertyName(String propName) {
|
||||||
|
if (propName == null)
|
||||||
|
return null;
|
||||||
|
if (caseInsensitive)
|
||||||
|
return propName.toLowerCase();
|
||||||
|
return propName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the application's classloader
|
* Return the application's classloader
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class Session implements Serializable {
|
||||||
this.app = app;
|
this.app = app;
|
||||||
this.uid = null;
|
this.uid = null;
|
||||||
this.userHandle = null;
|
this.userHandle = null;
|
||||||
cacheNode = new TransientNode("session");
|
cacheNode = new TransientNode(app, "session");
|
||||||
cacheLastModified = cacheNode.lastModified();
|
cacheLastModified = cacheNode.lastModified();
|
||||||
// HACK - decrease timestamp by 1 to notice modifications
|
// HACK - decrease timestamp by 1 to notice modifications
|
||||||
// taking place immediately after object creation
|
// taking place immediately after object creation
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
package helma.objectmodel;
|
package helma.objectmodel;
|
||||||
|
|
||||||
import helma.framework.IPathElement;
|
import helma.framework.IPathElement;
|
||||||
|
import helma.framework.core.Application;
|
||||||
|
import helma.framework.core.RequestEvaluator;
|
||||||
import helma.objectmodel.db.DbMapping;
|
import helma.objectmodel.db.DbMapping;
|
||||||
import helma.objectmodel.db.Relation;
|
import helma.objectmodel.db.Relation;
|
||||||
import helma.objectmodel.db.Node;
|
import helma.objectmodel.db.Node;
|
||||||
|
@ -44,6 +46,7 @@ public class TransientNode implements INode, Serializable {
|
||||||
protected long lastmodified;
|
protected long lastmodified;
|
||||||
protected String id;
|
protected String id;
|
||||||
protected String name;
|
protected String name;
|
||||||
|
private final Application app;
|
||||||
|
|
||||||
// is the main identity a named property or an anonymous node in a collection?
|
// is the main identity a named property or an anonymous node in a collection?
|
||||||
protected boolean anonymous = false;
|
protected boolean anonymous = false;
|
||||||
|
@ -53,21 +56,27 @@ public class TransientNode implements INode, Serializable {
|
||||||
/**
|
/**
|
||||||
* Creates a new TransientNode object.
|
* Creates a new TransientNode object.
|
||||||
*/
|
*/
|
||||||
public TransientNode() {
|
public TransientNode(Application app) {
|
||||||
id = generateID();
|
id = generateID();
|
||||||
name = id;
|
name = id;
|
||||||
created = lastmodified = System.currentTimeMillis();
|
created = lastmodified = System.currentTimeMillis();
|
||||||
|
this.app=app;
|
||||||
|
}
|
||||||
|
|
||||||
|
private TransientNode() {
|
||||||
|
app=null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make a new TransientNode object with a given name
|
* Make a new TransientNode object with a given name
|
||||||
*/
|
*/
|
||||||
public TransientNode(String n) {
|
public TransientNode(Application app, String n) {
|
||||||
id = generateID();
|
id = generateID();
|
||||||
name = (n == null || n.length() == 0) ? id : n;
|
name = (n == null || n.length() == 0) ? id : n;
|
||||||
// HACK - decrease creation and last-modified timestamp by 1 so we notice
|
// HACK - decrease creation and last-modified timestamp by 1 so we notice
|
||||||
// modifications that take place immediately after object creation
|
// modifications that take place immediately after object creation
|
||||||
created = lastmodified = System.currentTimeMillis() - 1;
|
created = lastmodified = System.currentTimeMillis() - 1;
|
||||||
|
this.app = app;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String generateID() {
|
public static String generateID() {
|
||||||
|
@ -236,7 +245,7 @@ public class TransientNode implements INode, Serializable {
|
||||||
anon = true;
|
anon = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
INode n = new TransientNode(nm);
|
INode n = new TransientNode(app, nm);
|
||||||
|
|
||||||
if (anon) {
|
if (anon) {
|
||||||
addNode(n, where);
|
addNode(n, where);
|
||||||
|
@ -367,7 +376,8 @@ public class TransientNode implements INode, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private TransientProperty getProperty(String propname) {
|
private TransientProperty getProperty(String propname) {
|
||||||
TransientProperty prop = (propMap == null) ? null : (TransientProperty) propMap.get(propname);
|
TransientProperty prop = (propMap == null) ? null
|
||||||
|
: (TransientProperty) propMap.get(correctPropertyName(propname));
|
||||||
|
|
||||||
// check if we have to create a virtual node
|
// check if we have to create a virtual node
|
||||||
if ((prop == null) && (dbmap != null)) {
|
if ((prop == null) && (dbmap != null)) {
|
||||||
|
@ -388,7 +398,7 @@ public class TransientNode implements INode, Serializable {
|
||||||
node.setDbMapping(rel.getVirtualMapping());
|
node.setDbMapping(rel.getVirtualMapping());
|
||||||
setNode(propname, node);
|
setNode(propname, node);
|
||||||
|
|
||||||
return (TransientProperty) propMap.get(propname);
|
return (TransientProperty) propMap.get(correctPropertyName(propname));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IProperty get(String propname) {
|
public IProperty get(String propname) {
|
||||||
|
@ -485,11 +495,12 @@ public class TransientNode implements INode, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
TransientProperty prop = (TransientProperty) propMap.get(propname);
|
String cpn = correctPropertyName(propname);
|
||||||
|
TransientProperty prop = (TransientProperty) propMap.get(cpn);
|
||||||
|
|
||||||
if (prop == null) {
|
if (prop == null) {
|
||||||
prop = new TransientProperty(propname, this);
|
prop = new TransientProperty(propname, this);
|
||||||
propMap.put(propname, prop);
|
propMap.put(cpn, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
return prop;
|
return prop;
|
||||||
|
@ -552,7 +563,7 @@ public class TransientNode implements INode, Serializable {
|
||||||
|
|
||||||
public void unset(String propname) {
|
public void unset(String propname) {
|
||||||
if (propMap != null && propname != null) {
|
if (propMap != null && propname != null) {
|
||||||
propMap.remove(propname);
|
propMap.remove(correctPropertyName(propname));
|
||||||
lastmodified = System.currentTimeMillis();
|
lastmodified = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,7 +587,7 @@ public class TransientNode implements INode, Serializable {
|
||||||
*/
|
*/
|
||||||
public synchronized INode getCacheNode() {
|
public synchronized INode getCacheNode() {
|
||||||
if (cacheNode == null) {
|
if (cacheNode == null) {
|
||||||
cacheNode = new TransientNode();
|
cacheNode = new TransientNode(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cacheNode;
|
return cacheNode;
|
||||||
|
@ -588,4 +599,8 @@ public class TransientNode implements INode, Serializable {
|
||||||
public synchronized void clearCacheNode() {
|
public synchronized void clearCacheNode() {
|
||||||
cacheNode = null;
|
cacheNode = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String correctPropertyName(String propname) {
|
||||||
|
return app.correctPropertyName(propname);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,6 +315,7 @@ public final class DbMapping {
|
||||||
// ignore internal properties (starting with "_") and sub-options (containing a ".")
|
// ignore internal properties (starting with "_") and sub-options (containing a ".")
|
||||||
if (!propName.startsWith("_") && propName.indexOf(".") < 0) {
|
if (!propName.startsWith("_") && propName.indexOf(".") < 0) {
|
||||||
Object propValue = entry.getValue();
|
Object propValue = entry.getValue();
|
||||||
|
propName = app.correctPropertyName(propName);
|
||||||
|
|
||||||
// check if a relation for this propery already exists. If so, reuse it
|
// check if a relation for this propery already exists. If so, reuse it
|
||||||
Relation rel = (Relation) prop2db.get(propName);
|
Relation rel = (Relation) prop2db.get(propName);
|
||||||
|
@ -637,7 +638,7 @@ public final class DbMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String _propertyToColumnName(final String propName) {
|
private String _propertyToColumnName(final String propName) {
|
||||||
Relation rel = (Relation) prop2db.get(propName);
|
Relation rel = (Relation) prop2db.get(app.correctPropertyName(propName));
|
||||||
|
|
||||||
if ((rel == null) && (parentMapping != null)) {
|
if ((rel == null) && (parentMapping != null)) {
|
||||||
return parentMapping._propertyToColumnName(propName);
|
return parentMapping._propertyToColumnName(propName);
|
||||||
|
@ -683,7 +684,7 @@ public final class DbMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Relation _propertyToRelation(String propName) {
|
private Relation _propertyToRelation(String propName) {
|
||||||
Relation rel = (Relation) prop2db.get(propName);
|
Relation rel = (Relation) prop2db.get(app.correctPropertyName(propName));
|
||||||
|
|
||||||
if ((rel == null) && (parentMapping != null)) {
|
if ((rel == null) && (parentMapping != null)) {
|
||||||
return parentMapping._propertyToRelation(propName);
|
return parentMapping._propertyToRelation(propName);
|
||||||
|
@ -866,7 +867,7 @@ public final class DbMapping {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Relation rel = (Relation) prop2db.get(propname);
|
Relation rel = (Relation) prop2db.get(app.correctPropertyName(propname));
|
||||||
|
|
||||||
if ((rel == null) && (parentMapping != null)) {
|
if ((rel == null) && (parentMapping != null)) {
|
||||||
rel = parentMapping.getExactPropertyRelation(propname);
|
rel = parentMapping.getExactPropertyRelation(propname);
|
||||||
|
|
|
@ -1602,7 +1602,8 @@ public final class Node implements INode {
|
||||||
null : dbmap.getExactPropertyRelation(propname);
|
null : dbmap.getExactPropertyRelation(propname);
|
||||||
|
|
||||||
// 1) check if the property is contained in the propMap
|
// 1) check if the property is contained in the propMap
|
||||||
Property prop = propMap == null ? null : (Property) propMap.get(propname);
|
Property prop = propMap == null ? null :
|
||||||
|
(Property) propMap.get(correctPropertyName(propname));
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
if (rel != null) {
|
if (rel != null) {
|
||||||
|
@ -1631,7 +1632,7 @@ public final class Node implements INode {
|
||||||
n.setDbMapping(rel.getVirtualMapping());
|
n.setDbMapping(rel.getVirtualMapping());
|
||||||
n.setParent(this);
|
n.setParent(this);
|
||||||
setNode(propname, n);
|
setNode(propname, n);
|
||||||
return (Property) propMap.get(propname);
|
return (Property) propMap.get(correctPropertyName(propname));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2) check if this is a create-on-demand node property
|
// 2) check if this is a create-on-demand node property
|
||||||
|
@ -1798,14 +1799,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setValue(value, type);
|
prop.setValue(value, type);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setValue(value, type);
|
prop.setValue(value, type);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastmodified = System.currentTimeMillis();
|
lastmodified = System.currentTimeMillis();
|
||||||
|
@ -1833,7 +1835,8 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
String oldvalue = null;
|
String oldvalue = null;
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
|
@ -1848,7 +1851,7 @@ public final class Node implements INode {
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setStringValue(value);
|
prop.setStringValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dbmap != null) {
|
if (dbmap != null) {
|
||||||
|
@ -1944,14 +1947,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setIntegerValue(value);
|
prop.setIntegerValue(value);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setIntegerValue(value);
|
prop.setIntegerValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyPropertyChange(propname);
|
notifyPropertyChange(propname);
|
||||||
|
@ -1981,14 +1985,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setFloatValue(value);
|
prop.setFloatValue(value);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setFloatValue(value);
|
prop.setFloatValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyPropertyChange(propname);
|
notifyPropertyChange(propname);
|
||||||
|
@ -2018,14 +2023,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setBooleanValue(value);
|
prop.setBooleanValue(value);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setBooleanValue(value);
|
prop.setBooleanValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyPropertyChange(propname);
|
notifyPropertyChange(propname);
|
||||||
|
@ -2055,14 +2061,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setDateValue(value);
|
prop.setDateValue(value);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setDateValue(value);
|
prop.setDateValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyPropertyChange(propname);
|
notifyPropertyChange(propname);
|
||||||
|
@ -2092,14 +2099,15 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
Property prop = (Property) propMap.get(propname);
|
String p2 = correctPropertyName(propname);
|
||||||
|
Property prop = (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
prop.setJavaObjectValue(value);
|
prop.setJavaObjectValue(value);
|
||||||
} else {
|
} else {
|
||||||
prop = new Property(propname, this);
|
prop = new Property(propname, this);
|
||||||
prop.setJavaObjectValue(value);
|
prop.setJavaObjectValue(value);
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyPropertyChange(propname);
|
notifyPropertyChange(propname);
|
||||||
|
@ -2177,6 +2185,7 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
|
|
||||||
propname = propname.trim();
|
propname = propname.trim();
|
||||||
|
String p2 = correctPropertyName(propname);
|
||||||
if (rel == null && dbmap != null) {
|
if (rel == null && dbmap != null) {
|
||||||
// widen relation to non-exact (collection) mapping
|
// widen relation to non-exact (collection) mapping
|
||||||
rel = dbmap.getPropertyRelation(propname);
|
rel = dbmap.getPropertyRelation(propname);
|
||||||
|
@ -2191,7 +2200,7 @@ public final class Node implements INode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Property prop = (propMap == null) ? null : (Property) propMap.get(propname);
|
Property prop = (propMap == null) ? null : (Property) propMap.get(p2);
|
||||||
|
|
||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
if ((prop.getType() == IProperty.NODE) &&
|
if ((prop.getType() == IProperty.NODE) &&
|
||||||
|
@ -2223,7 +2232,7 @@ public final class Node implements INode {
|
||||||
propMap = new Hashtable();
|
propMap = new Hashtable();
|
||||||
}
|
}
|
||||||
|
|
||||||
propMap.put(propname, prop);
|
propMap.put(p2, prop);
|
||||||
|
|
||||||
if (state == CLEAN && isPersistable) {
|
if (state == CLEAN && isPersistable) {
|
||||||
markAs(MODIFIED);
|
markAs(MODIFIED);
|
||||||
|
@ -2273,9 +2282,9 @@ public final class Node implements INode {
|
||||||
|
|
||||||
if (propMap != null) {
|
if (propMap != null) {
|
||||||
if (relational) {
|
if (relational) {
|
||||||
p = (Property) propMap.get(propname);
|
p = (Property) propMap.get(correctPropertyName(propname));
|
||||||
} else {
|
} else {
|
||||||
p = (Property) propMap.remove(propname);
|
p = (Property) propMap.remove(correctPropertyName(propname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2477,7 +2486,7 @@ public final class Node implements INode {
|
||||||
*/
|
*/
|
||||||
public synchronized INode getCacheNode() {
|
public synchronized INode getCacheNode() {
|
||||||
if (cacheNode == null) {
|
if (cacheNode == null) {
|
||||||
cacheNode = new TransientNode();
|
cacheNode = new TransientNode(this.getApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
return cacheNode;
|
return cacheNode;
|
||||||
|
@ -2558,4 +2567,8 @@ public final class Node implements INode {
|
||||||
private Application getApp() {
|
private Application getApp() {
|
||||||
return nmgr.nmgr.app;
|
return nmgr.nmgr.app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String correctPropertyName(String propname) {
|
||||||
|
return getApp().correctPropertyName(propname);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -144,7 +144,7 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
||||||
currentNode.setPropMap(propMap);
|
currentNode.setPropMap(propMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
propMap.put(propName, prop);
|
propMap.put(correctPropertyName(propName), prop);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// a primitive property
|
// a primitive property
|
||||||
|
@ -170,6 +170,10 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String correctPropertyName(String propName) {
|
||||||
|
return this.currentNode.getDbMapping().getApplication().correctPropertyName(propName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -233,7 +237,7 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
||||||
currentNode.setPropMap(propMap);
|
currentNode.setPropMap(propMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
propMap.put(elementName, prop);
|
propMap.put(correctPropertyName(elementName), prop);
|
||||||
elementName = null;
|
elementName = null;
|
||||||
elementType = null;
|
elementType = null;
|
||||||
charValue = null;
|
charValue = null;
|
||||||
|
|
|
@ -1133,7 +1133,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
if (node == null || node.getState() == Node.INVALID) {
|
if (node == null || node.getState() == Node.INVALID) {
|
||||||
// We probably have a deleted node.
|
// We probably have a deleted node.
|
||||||
// Replace with empty transient node to avoid throwing an exception.
|
// Replace with empty transient node to avoid throwing an exception.
|
||||||
node = new TransientNode();
|
node = new TransientNode(core.app);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
|
|
Loading…
Add table
Reference in a new issue