Map queryChildren = groupChildrenByName(queryNode);
treatExtensions((List) queryChildren.get("extension"), spq);
return spq;
}
private SpeedoFetchGroup getFetchGroup(Node fgNode, SpeedoClass fieldOwner) throws SpeedoException {
SpeedoFetchGroup fg = new SpeedoFetchGroup();
//<!ATTLIST fetch-group name CDATA #REQUIRED>
Node n = fgNode.getAttributes().getNamedItem("name");
fg.name = n.getNodeValue();
//<!ATTLIST fetch-group post-load (true|false) #IMPLIED>
n = fgNode.getAttributes().getNamedItem("post-load");
if (n != null){
fg.postLoad = Boolean.valueOf(n.getNodeValue()).booleanValue();
} else {
if (fg.name.equals("default")) {
fg.postLoad = true;
} else {
fg.postLoad = false;
}
}
Map fgChildren = groupChildrenByName(fgNode);
//<!ELEMENT fetch-group (fetch-group|field)*>
List l = (List) fgChildren.get("field");
if (l != null) {
for (int j = 0; j < l.size(); j++) {
Node fieldNode = (Node) l.get(j);
String fieldName = getStringAttributeValue(fieldNode, "name", null);
if (fieldName != null) {
SpeedoField field = fieldOwner.getField(fieldName);
if (field != null) {
fg.addField(field);
} else {
logger.log(BasicLevel.WARN, "Bad field name '"
+ fieldName + "'in the fetch group '"
+ fg.name + "' in the class "
+ fieldOwner.getSourceDesc() + ".");
}
}
}
}
l = (List) fgChildren.get("fetch-group");
if (l != null) {
for (int j = 0; j < l.size(); j++) {
SpeedoFetchGroup subfg = getFetchGroup((Node) l.get(j), fieldOwner);
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "add fetchgroup '"
+ subfg.name + "' into the fetchgroup '"
+ fg.name +"'");
}