本文整理汇总了Java中com.haulmont.cuba.core.global.LoadContext.setQueryString方法的典型用法代码示例。如果您正苦于以下问题:Java LoadContext.setQueryString方法的具体用法?Java LoadContext.setQueryString怎么用?Java LoadContext.setQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.haulmont.cuba.core.global.LoadContext
的用法示例。
在下文中一共展示了LoadContext.setQueryString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllProjects
import com.haulmont.cuba.core.global.LoadContext; //导入方法依赖的package包/类
protected List<Project> getAllProjects() {
LoadContext<Project> loadContext = new LoadContext<>(Project.class)
.setView("project-full");
loadContext.setQueryString("select e from ts$Project e");
return dataManager.loadList(loadContext);
}
示例2: getInstances
import com.haulmont.cuba.core.global.LoadContext; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List<JmxInstance> getInstances() {
LoadContext loadContext = new LoadContext(JmxInstance.class);
loadContext.setView("_local");
loadContext.setQueryString("select jmx from sys$JmxInstance jmx");
List<JmxInstance> jmxInstances = new ArrayList<>();
jmxInstances.add(getLocalInstance());
List<JmxInstance> clusterInstances = dataService.loadList(loadContext);
jmxInstances.addAll(clusterInstances);
return jmxInstances;
}
示例3: testLoadTariffVersions
import com.haulmont.cuba.core.global.LoadContext; //导入方法依赖的package包/类
@Test
public void testLoadTariffVersions() {
LoadContext<SeveralFetchGroups_TariffVersion> loadContext = new LoadContext<>(SeveralFetchGroups_TariffVersion.class);
loadContext.setQueryString("select e from test$SeveralFetchGroups_TariffVersion e order by e.name asc");
loadContext.setView("tariffVersion.withParent");
List<SeveralFetchGroups_TariffVersion> result = dataManager.loadList(loadContext);
for (SeveralFetchGroups_TariffVersion version : result) {
Assert.assertNotNull(version.getParent());
}
}
示例4: load
import com.haulmont.cuba.core.global.LoadContext; //导入方法依赖的package包/类
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);
}
示例5: index
import com.haulmont.cuba.core.global.LoadContext; //导入方法依赖的package包/类
@RequestMapping(value = "/", method = RequestMethod.GET)
public String index(Model model) {
if (!PortalSessionProvider.getUserSession().isAuthenticated()) {
final LoginUserCommand loginUserCommand = new LoginUserCommand();
model.addAttribute(loginUserCommand);
}
LoadContext l = LoadContext.create(Product.class).setView("product-view");
l.setQueryString("select p from om$Product p");
model.addAttribute("products", dataService.loadList(l));
return "index";
}