c.inheritance.superClassName = n.getNodeValue();
}
//attribute table
n = classNode.getAttributes().getNamedItem("table");
if (n != null) {
c.mainTable = new SpeedoTable();
c.mainTable.name = n.getNodeValue();
}
if (c.mainTable == null) {
if (c.inheritance == null
|| c.inheritance.strategy == SpeedoInheritance.STRATEGY_NEW_TABLE) {
c.mainTable = new SpeedoTable();
c.mainTable.name = c.name.toUpperCase();
}
}
logger.log(BasicLevel.DEBUG, "New class: "
+ "name=" + c.name
+ " / id = " + c.getIdentityType()
+ " / idClass = " + c.identity.objectidClass
+ " / detachable = " + c.isDetachable
);
Map classChildren = groupChildrenByName(classNode);
//extension*, implements*, datastore-identity?, inheritance?, version?,
// join*, foreign-key*, index*, unique*, field*, query*, fetch-group*, extension*
treatExtensions((List) classChildren.get("extension"), c);
List l = (List) classChildren.get("datastore-identity");
if (l != null) {
treatDataStoreId((Node) l.get(0), c);
}
l = (List) classChildren.get("inheritance");
if (l != null) {
treatInheritance((Node) l.get(0), c);
}
l = (List) classChildren.get("version");
if (l != null) {
treatVersion((Node) l.get(0), c);
}
l = (List) classChildren.get("join");
if (l != null) {
for (int j = 0; j < l.size(); j++) {
Object[] os = getJoin((Node) l.get(j), null);
SpeedoJoin join = (SpeedoJoin) os[0];
String tableName = (String) os[1];
//define an external/secondary table
c.addJoin(join);
if (c.mainTable != null) {
join.mainTable = c.mainTable;
}
if (tableName != null) {
join.extTable = new SpeedoTable();
join.extTable.name = tableName;
join.extTable.join = join;
}
}
}