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);
|
||||
|
||||
DbMapping dbm = node.getDbMapping ();
|
||||
boolean markMappingAsUpdated = false;
|
||||
|
||||
if (dbm == null || !dbm.isRelational ()) {
|
||||
db.saveNode (txn, node.getID (), node);
|
||||
|
@ -503,6 +504,8 @@ public final class NodeManager {
|
|||
break;
|
||||
}
|
||||
p.dirty = false;
|
||||
if (!rel.isPrivate())
|
||||
markMappingAsUpdated = true;
|
||||
}
|
||||
|
||||
} else if (rel != null && rel.getDbField() != null) {
|
||||
|
@ -522,7 +525,8 @@ public final class NodeManager {
|
|||
tds.close ();
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
dbm.notifyDataChange ();
|
||||
if (markMappingAsUpdated)
|
||||
dbm.notifyDataChange ();
|
||||
}
|
||||
// update may cause changes in the node's parent subnode array
|
||||
if (node.isAnonymous()) {
|
||||
|
|
|
@ -53,6 +53,7 @@ public final class Relation {
|
|||
boolean aggressiveLoading;
|
||||
boolean aggressiveCaching;
|
||||
boolean subnodesAreProperties;
|
||||
boolean isPrivate;
|
||||
String accessor; // db column used to access objects through this relation
|
||||
String order;
|
||||
String groupbyorder;
|
||||
|
@ -132,13 +133,15 @@ public final class Relation {
|
|||
columnName = desc;
|
||||
reftype = PRIMITIVE;
|
||||
}
|
||||
String rdonly = props.getProperty (desc+".readonly");
|
||||
if (rdonly != null && "true".equalsIgnoreCase (rdonly)) {
|
||||
readonly = true;
|
||||
} else {
|
||||
readonly = false;
|
||||
}
|
||||
}
|
||||
String rdonly = props.getProperty (desc+".readonly");
|
||||
if (rdonly != null && "true".equalsIgnoreCase (rdonly)) {
|
||||
readonly = true;
|
||||
} else {
|
||||
readonly = false;
|
||||
}
|
||||
isPrivate = "true".equalsIgnoreCase (props.getProperty (desc+".private"));
|
||||
|
||||
// the following options only apply to object and collection relations
|
||||
if (reftype != PRIMITIVE && reftype != INVALID) {
|
||||
|
||||
|
@ -408,6 +411,15 @@ public final class Relation {
|
|||
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.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue