Fix: Don't set parent prototype in prototypes unless it is exlicitly defined in
type.properties file. If it isn't explicitly defined, the scripting engine will check the right runtime parent prototype depending on whether the prototype is a HopObject or Java object prototype.
This commit is contained in:
parent
7938ab4e8d
commit
d8190ed3b2
1 changed files with 4 additions and 17 deletions
|
@ -65,20 +65,6 @@ public final class TypeManager {
|
||||||
registerPrototype (pname, new File (appDir, pname), proto);
|
registerPrototype (pname, new File (appDir, pname), proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Prototype hobjectProto = getPrototype ("hopobject");
|
|
||||||
// loop through freshly created prototypes and rewire them,
|
|
||||||
// i.e. establish connections between them (inherit, collection etc.)
|
|
||||||
for (Iterator i = prototypes.values().iterator(); i.hasNext(); ) {
|
|
||||||
Prototype proto = (Prototype) i.next();
|
|
||||||
DbMapping dbm = proto.getDbMapping ();
|
|
||||||
dbm.update ();
|
|
||||||
// set parent prototype
|
|
||||||
String parentName = dbm.getExtends ();
|
|
||||||
if (parentName == null)
|
|
||||||
proto.setParentPrototype (hobjectProto);
|
|
||||||
else
|
|
||||||
proto.setParentPrototype (getPrototype (parentName));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,9 +124,10 @@ public final class TypeManager {
|
||||||
dbmap.update ();
|
dbmap.update ();
|
||||||
// set parent prototype, in case it has changed.
|
// set parent prototype, in case it has changed.
|
||||||
String parentName = dbmap.getExtends ();
|
String parentName = dbmap.getExtends ();
|
||||||
if (parentName == null)
|
if (parentName != null)
|
||||||
parentName = "hopobject";
|
proto.setParentPrototype (getPrototype (parentName));
|
||||||
proto.setParentPrototype (getPrototype (parentName));
|
else
|
||||||
|
proto.setParentPrototype (null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue