final String error = "dbType is null for typename: " + typeName;
LOG.error(error);
throw new NullPointerException(error);
}
final DbTypeField fieldDef = dbType.getFieldByPos(i);
DbResultNode node = null;
if (fieldDef == null) {
LOG.error("Could not find field in {} for pos ", dbType, i);
continue;
}
if (fieldDef.getType().equals("USER-DEFINED")) {
if (fieldDef.getTypeName().equals("hstore")) {
node = new SimpleResultNode(fieldValue, fieldDef.getName());
} else if (fieldDef.getTypeName().equals("enumeration")) {
node = new SimpleResultNode(fieldValue, fieldDef.getName());
} else {
node = new ObjectResultNode(fieldValue, fieldDef.getName(), fieldDef.getTypeName(),
fieldDef.getTypeId(), connection);
}
} else if (fieldDef.getType().equals("ARRAY")) {
node = new ArrayResultNode(fieldDef.getName(), fieldValue, fieldDef.getTypeName().substring(1),
fieldDef.getTypeId(), connection);
} else {
node = new SimpleResultNode(fieldValue, fieldDef.getName());
}
this.children.add(node);
i++;
}