Add support for private properties of hopobject, which don't cause

object indexes to be reloaded when modified.
This commit is contained in:
hns 2002-06-18 10:47:58 +00:00
parent 84e0eb7748
commit 05c8263281
2 changed files with 23 additions and 7 deletions

View file

@ -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()) {

View file

@ -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.
*/