Search in sources :

Example 1 with SubstancePropertyCategory

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);
    }
}
Also used : SubstanceName(ambit2.base.data.substance.SubstanceName) SubstanceOwner(ambit2.base.data.substance.SubstanceOwner) SubstancePropertyCategory(ambit2.base.data.substance.SubstancePropertyCategory) SubstanceUUID(ambit2.base.data.substance.SubstanceUUID) LiteratureEntry(ambit2.base.data.LiteratureEntry) Protocol(ambit2.base.data.study.Protocol) AmbitException(net.idea.modbcum.i.exceptions.AmbitException) SubstancePublicName(ambit2.base.data.substance.SubstancePublicName) AmbitException(net.idea.modbcum.i.exceptions.AmbitException)

Aggregations

LiteratureEntry (ambit2.base.data.LiteratureEntry)1 Protocol (ambit2.base.data.study.Protocol)1 SubstanceName (ambit2.base.data.substance.SubstanceName)1 SubstanceOwner (ambit2.base.data.substance.SubstanceOwner)1 SubstancePropertyCategory (ambit2.base.data.substance.SubstancePropertyCategory)1 SubstancePublicName (ambit2.base.data.substance.SubstancePublicName)1 SubstanceUUID (ambit2.base.data.substance.SubstanceUUID)1 AmbitException (net.idea.modbcum.i.exceptions.AmbitException)1