if (source instanceof PartyType) { PartyType s = (PartyType) source;
if (source instanceof PartyTypeEnum) { PartyTypeEnum s = (PartyTypeEnum) source;
    public Object javaToSql(Object source) throws ConversionException {        if (source instanceof PartyType) {            PartyType s = (PartyType) source;            return s.name();        }        return source;    }