use of com.haulmont.cuba.core.global.DataManager in project cuba by cuba-platform.
the class DataManagerDistinctResultsTest method load.
private LinkedHashSet<User> load(int firstResult, int maxResults, String queryString) {
DataManager ds = AppBeans.get(DataManager.NAME);
LoadContext<User> lc = new LoadContext<>(User.class);
LoadContext.Query q = lc.setQueryString(queryString);
q.setParameter("groupId", groupId);
q.setFirstResult(firstResult);
q.setMaxResults(maxResults);
List<User> list = ds.loadList(lc);
return new LinkedHashSet<>(list);
}
use of com.haulmont.cuba.core.global.DataManager in project cuba by cuba-platform.
the class HsqlLikeNullFailTest method setUp.
@Before
public void setUp() throws Exception {
DataManager dataManager = AppBeans.get(DataManager.NAME);
Group group = dataManager.load(new LoadContext<>(Group.class).setId(UUID.fromString("0fa2b1a5-1d68-4d69-9fbd-dff348347f93")));
User user = new User();
user.setGroup(group);
user.setId(UUID.fromString("de0f39d2-e60a-11e1-9b55-3860770d7eaf"));
user.setName("Test");
user.setLogin("tEst");
user.setLoginLowerCase("test");
dataManager.commit(user);
}
Aggregations