} else
return mo;
}
private Object treatClassNode(Node node, Object mo) throws SpeedoException {
SpeedoClass c = new SpeedoClass();
Node n = null;
//attribute name (compulsory)
n = node.getAttributes().getNamedItem("name");
if (n == null)
throw new SpeedoXMLError("Attribute name for tag class requested.");
c.name = c.nameForQuery = n.getNodeValue();
//attribute identity-type
n = node.getAttributes().getNamedItem("identity-type");
if (n != null)
c.setIdentityType(SpeedoIdentity.getStrategy(n.getNodeValue()));
//attribute object-id
n = node.getAttributes().getNamedItem("objectid-class");
if (n != null) {
c.identity.objectidClass = n.getNodeValue();
c.setIdentityType(SpeedoIdentity.USER_ID);
}
//attribute requires-extent is not taking in account
//attribute detachable
n = node.getAttributes().getNamedItem("detachable");
if (n != null)
c.isDetachable = Boolean.valueOf(n.getNodeValue()).booleanValue();
//attribute persistence-capable-superclass
n = node.getAttributes().getNamedItem("persistence-capable-superclass");
if (n != null) {
if (c.inheritance == null) {
c.inheritance = new SpeedoInheritance();
}
c.inheritance.superClassName = n.getNodeValue();
}
//attribute table
n = node.getAttributes().getNamedItem("table");
if (n != null) {
c.mainTable = new SpeedoTable();
c.mainTable.name = n.getNodeValue();
}
logger.log(BasicLevel.DEBUG, "New class: "
+ "name=" + c.name
+ " / id = " + c.getIdentityType()
+ " / idClass = " + c.identity.objectidClass
+ " / detachable = " + c.isDetachable
);
((SpeedoPackage) mo).addClass(c, true, logger);
return c;