@RolesAllowed("user") public <T extends IEnum> T getEnumeration(Class<T> k, String string) { IEnum e = iQuery.findByString(k, "value", string); iQuery.initialize(e); if (e == null) { throw new ApiUsageException(String.format( "An %s enum does not exist with the value: %s", k.getName(), string)); } return k.cast(e); }
@Override @RolesAllowed("user") @Transactional(readOnly = true) public Collection retrieveCollection(IObject arg0, String arg1, Parameters arg2) { IObject context = iQuery.get(arg0.getClass(), arg0.getId()); Collection c = (Collection) context.retrieve(arg1); // FIXME not // type.o.null safe iQuery.initialize(c); return c; }