use of ambit2.base.data.substance.SubstancePropertyCategory in project ambit-mirror by ideaconsult.
the class ReadEndpointsByBundle method getObject.
@Override
public Property getObject(ResultSet rs) throws AmbitException {
try {
Object hash = rs.getObject(3);
if (hash == null || "".equals(hash)) {
LiteratureEntry ref = new LiteratureEntry("", "Default");
ref.setType(_type.Substance);
Protocol._categories cat = null;
try {
cat = Protocol._categories.valueOf(rs.getString(2));
} catch (Exception x) {
}
SubstancePropertyCategory p = new SubstancePropertyCategory(rs.getString(1), rs.getString(2), cat == null ? null : String.format("%s. %s", cat.getNumber(), cat.toString()), null, ref);
p.setOrder(cat == null ? 0 : cat.getSortingOrder());
p.setIdentifier("");
return p;
} else {
if ("SubstancePublicName".equals(hash))
return new SubstancePublicName();
else if ("SubstanceName".equals(hash))
return new SubstanceName();
else if ("SubstanceUUID".equals(hash))
return new SubstanceUUID();
else if ("SubstanceOwner".equals(hash))
return new SubstanceOwner();
return null;
}
} catch (Exception x) {
throw new AmbitException(x);
}
}
Aggregations