本文整理汇总了Java中com.holonplatform.core.internal.query.QueryDefinition类的典型用法代码示例。如果您正苦于以下问题:Java QueryDefinition类的具体用法?Java QueryDefinition怎么用?Java QueryDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
QueryDefinition类属于com.holonplatform.core.internal.query包,在下文中一共展示了QueryDefinition类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testQuery
import com.holonplatform.core.internal.query.QueryDefinition; //导入依赖的package包/类
@Test
public void testQuery() {
QueryDefinition qd = new DefaultQueryDefinition();
Query q = new DummyQuery(qd);
q.target(DataTarget.named("target"));
assertEquals("target", qd.getTarget().get().getName());
q.parameter("tp", Integer.valueOf(1));
assertTrue(qd.hasParameters());
assertTrue(qd.hasParameter("tp"));
assertTrue(qd.hasNotNullParameter("tp"));
assertNotNull(qd.getParameter("tp"));
assertEquals(new Integer(1), qd.getParameter("tp", int.class).orElse(null));
assertEquals(new Integer(1), qd.getParameter("tp", int.class, Integer.valueOf(2)));
q.limit(10);
assertEquals(new Integer(10), qd.getLimit().get());
q.offset(20);
assertEquals(new Integer(20), qd.getOffset().get());
q.restrict(20, 100);
assertEquals(new Integer(20), qd.getLimit().get());
assertEquals(new Integer(100), qd.getOffset().get());
q.filter(TestPropertySet.NAME.isNotNull());
assertTrue(qd.getFilter().isPresent());
q.filter(TestPropertySet.NAME.isNotNull());
QuerySort qs = TestPropertySet.NAME.asc();
q.sort(qs);
assertEquals(qs, qd.getSort().get());
q.count();
q.stream(TestPropertySet.PROPERTIES);
q.findOne(TestPropertySet.PROPERTIES);
q.list(TestPropertySet.PROPERTIES);
q.stream(TestPropertySet.NAME);
q.findOne(TestPropertySet.NAME);
q.list(TestPropertySet.NAME);
q.stream(TestPropertySet.NAME, TestPropertySet.SEQUENCE);
q.findOne(TestPropertySet.NAME, TestPropertySet.SEQUENCE);
q.list(TestPropertySet.NAME, TestPropertySet.SEQUENCE);
}
示例2: DummyQuery
import com.holonplatform.core.internal.query.QueryDefinition; //导入依赖的package包/类
public DummyQuery(QueryDefinition queryDefinition) {
super(queryDefinition);
}
示例3: createCommodity
import com.holonplatform.core.internal.query.QueryDefinition; //导入依赖的package包/类
@Override
public Query createCommodity(JdbcDatastoreCommodityContext context) throws CommodityConfigurationException {
return new QueryAdapterQuery<>(context,
new JdbcQueryAdapter(context, context.getDialect(), context.isTraceEnabled()),
QueryDefinition.create());
}
示例4: getQueryDefinition
import com.holonplatform.core.internal.query.QueryDefinition; //导入依赖的package包/类
/**
* Query definition
* @return the queryDefinition
*/
protected QueryDefinition getQueryDefinition() {
return queryDefinition;
}