metaData.leftJoinList = leftJoins;
return metaData;
}
private static JDBCLeftJoinMetaData parseLeftJoin(XMLStreamReader reader) throws XMLStreamException {
final JDBCLeftJoinMetaData metaData = new JDBCLeftJoinMetaData();
final List<JDBCLeftJoinMetaData> leftJoins = new ArrayList<JDBCLeftJoinMetaData>();
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case CMR_FIELD: {
metaData.setCmrField(reader.getAttributeValue(i));
break;
}
case EAGER_LOAD_GROUP: {
metaData.setEagerLoadGroup(reader.getAttributeValue(i));
break;
}
default: {
throw unexpectedAttribute(reader, i);
}
}
}
for (Element element : children(reader)) {
switch (element) {
case LEFT_JOIN: {
leftJoins.add(parseLeftJoin(reader));
break;
}
default: {
throw unexpectedElement(reader);
}
}
}
metaData.setLeftJoins(leftJoins);
return metaData;
}