* "collection(Type)", but for relations defined from
* JavaScript, it is the top level descriptor object.
* @param props The subproperties for this relation.
*/
public void update(Object desc, Properties props) {
Application app = ownType.getApplication();
if (desc instanceof Properties || parseDescriptor(desc, props)) {
// converted to internal foo.collection = Bar representation
String proto;
if (props.containsKey("collection")) {
proto = props.getProperty("collection");
virtual = !"_children".equalsIgnoreCase(propName);
reftype = COLLECTION;
} else if (props.containsKey("mountpoint")) {
proto = props.getProperty("mountpoint");
reftype = COLLECTION;
virtual = true;
this.prototype = proto;
} else if (props.containsKey("object")) {
proto = props.getProperty("object");
if (reftype != COMPLEX_REFERENCE) {
reftype = REFERENCE;
}
virtual = false;
} else {
throw new RuntimeException("Invalid property Mapping: " + desc);
}
otherType = app.getDbMapping(proto);
if (otherType == null) {
throw new RuntimeException("DbMapping for " + proto +
" not found from " + ownType.getTypeName());
}