added getDbMapping(typename) method that gets the DbMapping for
a prototype name. changed sql argument encoding utility method: single quotes are now encoded as '' instead of \'
This commit is contained in:
parent
d66a280200
commit
df4d199072
1 changed files with 10 additions and 2 deletions
|
@ -16,7 +16,7 @@ import com.workingdogs.village.*;
|
||||||
* external data sources, caching them in a least-recently-used Hashtable,
|
* external data sources, caching them in a least-recently-used Hashtable,
|
||||||
* and writing changes back to the databases.
|
* and writing changes back to the databases.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final class NodeManager {
|
public final class NodeManager {
|
||||||
|
|
||||||
protected Application app;
|
protected Application app;
|
||||||
|
@ -985,6 +985,14 @@ public final class NodeManager {
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a DbMapping for a given prototype name. This is just a proxy
|
||||||
|
* method to the app's getDbMapping() method.
|
||||||
|
*/
|
||||||
|
public DbMapping getDbMapping (String protoname) {
|
||||||
|
return app.getDbMapping (protoname);
|
||||||
|
}
|
||||||
|
|
||||||
// a utility method to escape single quotes
|
// a utility method to escape single quotes
|
||||||
private String escape (String str) {
|
private String escape (String str) {
|
||||||
if (str == null)
|
if (str == null)
|
||||||
|
@ -996,7 +1004,7 @@ public final class NodeManager {
|
||||||
for (int i=0; i<l; i++) {
|
for (int i=0; i<l; i++) {
|
||||||
char c = str.charAt (i);
|
char c = str.charAt (i);
|
||||||
if (c == '\'')
|
if (c == '\'')
|
||||||
sbuf.append ("\\");
|
sbuf.append ('\'');
|
||||||
sbuf.append (c);
|
sbuf.append (c);
|
||||||
}
|
}
|
||||||
return sbuf.toString ();
|
return sbuf.toString ();
|
||||||
|
|
Loading…
Add table
Reference in a new issue