Add support for private properties of hopobject, which don't cause
object indexes to be reloaded when modified.
This commit is contained in:
parent
84e0eb7748
commit
05c8263281
2 changed files with 23 additions and 7 deletions
|
@ -443,6 +443,7 @@ public final class NodeManager {
|
||||||
// tx.timer.beginEvent ("updateNode "+node);
|
// tx.timer.beginEvent ("updateNode "+node);
|
||||||
|
|
||||||
DbMapping dbm = node.getDbMapping ();
|
DbMapping dbm = node.getDbMapping ();
|
||||||
|
boolean markMappingAsUpdated = false;
|
||||||
|
|
||||||
if (dbm == null || !dbm.isRelational ()) {
|
if (dbm == null || !dbm.isRelational ()) {
|
||||||
db.saveNode (txn, node.getID (), node);
|
db.saveNode (txn, node.getID (), node);
|
||||||
|
@ -503,6 +504,8 @@ public final class NodeManager {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
p.dirty = false;
|
p.dirty = false;
|
||||||
|
if (!rel.isPrivate())
|
||||||
|
markMappingAsUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (rel != null && rel.getDbField() != null) {
|
} else if (rel != null && rel.getDbField() != null) {
|
||||||
|
@ -522,6 +525,7 @@ public final class NodeManager {
|
||||||
tds.close ();
|
tds.close ();
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception ignore) {}
|
||||||
}
|
}
|
||||||
|
if (markMappingAsUpdated)
|
||||||
dbm.notifyDataChange ();
|
dbm.notifyDataChange ();
|
||||||
}
|
}
|
||||||
// update may cause changes in the node's parent subnode array
|
// update may cause changes in the node's parent subnode array
|
||||||
|
|
|
@ -53,6 +53,7 @@ public final class Relation {
|
||||||
boolean aggressiveLoading;
|
boolean aggressiveLoading;
|
||||||
boolean aggressiveCaching;
|
boolean aggressiveCaching;
|
||||||
boolean subnodesAreProperties;
|
boolean subnodesAreProperties;
|
||||||
|
boolean isPrivate;
|
||||||
String accessor; // db column used to access objects through this relation
|
String accessor; // db column used to access objects through this relation
|
||||||
String order;
|
String order;
|
||||||
String groupbyorder;
|
String groupbyorder;
|
||||||
|
@ -132,13 +133,15 @@ public final class Relation {
|
||||||
columnName = desc;
|
columnName = desc;
|
||||||
reftype = PRIMITIVE;
|
reftype = PRIMITIVE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
String rdonly = props.getProperty (desc+".readonly");
|
String rdonly = props.getProperty (desc+".readonly");
|
||||||
if (rdonly != null && "true".equalsIgnoreCase (rdonly)) {
|
if (rdonly != null && "true".equalsIgnoreCase (rdonly)) {
|
||||||
readonly = true;
|
readonly = true;
|
||||||
} else {
|
} else {
|
||||||
readonly = false;
|
readonly = false;
|
||||||
}
|
}
|
||||||
}
|
isPrivate = "true".equalsIgnoreCase (props.getProperty (desc+".private"));
|
||||||
|
|
||||||
// the following options only apply to object and collection relations
|
// the following options only apply to object and collection relations
|
||||||
if (reftype != PRIMITIVE && reftype != INVALID) {
|
if (reftype != PRIMITIVE && reftype != INVALID) {
|
||||||
|
|
||||||
|
@ -408,6 +411,15 @@ public final class Relation {
|
||||||
return readonly;
|
return readonly;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tell wether the property described by this relation is to be handled as private, i.e.
|
||||||
|
* a change on it should not result in any changed object/collection relations.
|
||||||
|
*/
|
||||||
|
public boolean isPrivate () {
|
||||||
|
return isPrivate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the child node fullfills the constraints defined by this relation.
|
* Check if the child node fullfills the constraints defined by this relation.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue