本文整理了Java中org.kie.server.api.model.definition.QueryParam.getColumn
方法的一些代码示例,展示了QueryParam.getColumn
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryParam.getColumn
方法的具体详情如下:
包路径:org.kie.server.api.model.definition.QueryParam
类名称:QueryParam
方法名:getColumn
暂无
代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend
@Test
public void testGroupWithNotSetInterval() {
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<QueryParam> filterParams = new ArrayList<>();
List<DataColumn> extraColumns = new ArrayList<>();
kieServerDataSetProvider.handleDataSetGroup(dataSetDef,
dataSetGroup,
filterParams,
extraColumns);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("group",
filterParams.get(0).getOperator());
assertEquals(1,
filterParams.get(0).getValue().size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getValue().get(0));
}
代码示例来源:origin: kiegroup/jbpm-wb
@Test
public void testGroupWithNotSetInterval() {
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<QueryParam> filterParams = new ArrayList<>();
List<DataColumn> extraColumns = new ArrayList<>();
kieServerDataSetProvider.handleDataSetGroup(dataSetDef,
dataSetGroup,
filterParams,
extraColumns);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("group",
filterParams.get(0).getOperator());
assertEquals(1,
filterParams.get(0).getValue().size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getValue().get(0));
}
代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend
@Test
public void appendBetweenIntervalSelectionTest() {
String filterValue = "testValue";
Long minValue = Long.valueOf(0);
Long maxValue = Long.valueOf(2);
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<Interval> intervalList = new ArrayList<Interval>();
Interval interval = new Interval(filterValue);
interval.setMinValue(minValue);
interval.setMaxValue(maxValue);
intervalList.add(interval);
dataSetGroup.setSelectedIntervalList(intervalList);
List<QueryParam> filterParams = new ArrayList<>();
kieServerDataSetProvider.appendIntervalSelection(dataSetGroup,
filterParams);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("BETWEEN",
filterParams.get(0).getOperator());
assertEquals(Double.valueOf(minValue),
filterParams.get(0).getValue().get(0));
assertEquals(Double.valueOf(maxValue),
filterParams.get(0).getValue().get(1));
}
代码示例来源:origin: kiegroup/jbpm-wb
@Test
public void appendEqualToIntervalSelectionTest() {
String filterValue = "testValue";
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<Interval> intervalList = new ArrayList<Interval>();
Interval interval = new Interval(filterValue);
intervalList.add(interval);
dataSetGroup.setSelectedIntervalList(intervalList);
List<QueryParam> filterParams = new ArrayList<>();
kieServerDataSetProvider.appendIntervalSelection(dataSetGroup,
filterParams);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("EQUALS_TO",
filterParams.get(0).getOperator());
assertEquals(filterValue,
filterParams.get(0).getValue().get(0));
}
代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend
@Test
public void appendEqualToIntervalSelectionTest() {
String filterValue = "testValue";
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<Interval> intervalList = new ArrayList<Interval>();
Interval interval = new Interval(filterValue);
intervalList.add(interval);
dataSetGroup.setSelectedIntervalList(intervalList);
List<QueryParam> filterParams = new ArrayList<>();
kieServerDataSetProvider.appendIntervalSelection(dataSetGroup,
filterParams);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("EQUALS_TO",
filterParams.get(0).getOperator());
assertEquals(filterValue,
filterParams.get(0).getValue().get(0));
}
代码示例来源:origin: kiegroup/jbpm-wb
@Test
public void appendBetweenIntervalSelectionTest() {
String filterValue = "testValue";
Long minValue = Long.valueOf(0);
Long maxValue = Long.valueOf(2);
DataSetGroup dataSetGroup = new DataSetGroup();
dataSetGroup.setColumnGroup(new ColumnGroup(COLUMN_TEST,
COLUMN_TEST,
GroupStrategy.DYNAMIC));
List<Interval> intervalList = new ArrayList<Interval>();
Interval interval = new Interval(filterValue);
interval.setMinValue(minValue);
interval.setMaxValue(maxValue);
intervalList.add(interval);
dataSetGroup.setSelectedIntervalList(intervalList);
List<QueryParam> filterParams = new ArrayList<>();
kieServerDataSetProvider.appendIntervalSelection(dataSetGroup,
filterParams);
assertEquals(1,
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("BETWEEN",
filterParams.get(0).getOperator());
assertEquals(Double.valueOf(minValue),
filterParams.get(0).getValue().get(0));
assertEquals(Double.valueOf(maxValue),
filterParams.get(0).getValue().get(1));
}
代码示例来源:origin: org.jbpm/jbpm-wb-kie-server-backend
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("group",
filterParams.get(0).getOperator());
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Test
public void testGetBetween() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date from = null;
Date to = null;
try {
from = sdf.parse("2017-05-10");
to = sdf.parse("2017-05-14");
} catch (ParseException e) {
e.printStackTrace();
}
TaskQueryFilterSpec filterSpec = new TaskQueryFilterSpecBuilder().between(TaskField.CREATEDON, from, to).get();
QueryParam[] params = filterSpec.getParameters();
assertEquals(1, params.length);
QueryParam param = params[0];
assertEquals(TaskField.CREATEDON.toString(), param.getColumn());
assertEquals("BETWEEN", param.getOperator());
List<?> values = param.getValue();
assertEquals(2, values.size());
assertEquals(from, values.get(0));
assertEquals(to, values.get(1));
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Test
public void testGetBetween() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date from = null;
Date to = null;
try {
from = sdf.parse("2017-05-10");
to = sdf.parse("2017-05-14");
} catch (ParseException e) {
e.printStackTrace();
}
ProcessInstanceQueryFilterSpec filterSpec = new ProcessInstanceQueryFilterSpecBuilder().between(ProcessInstanceField.START_DATE, from, to).get();
QueryParam[] params = filterSpec.getParameters();
assertEquals(1, params.length);
QueryParam param = params[0];
assertEquals(ProcessInstanceField.START_DATE.toString(), param.getColumn());
assertEquals("BETWEEN", param.getOperator());
List<?> values = param.getValue();
assertEquals(2, values.size());
assertEquals(from, values.get(0));
assertEquals(to, values.get(1));
}
代码示例来源:origin: kiegroup/jbpm-wb
filterParams.size());
assertEquals(COLUMN_TEST,
filterParams.get(0).getColumn());
assertEquals("group",
filterParams.get(0).getOperator());
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Test
public void testGetEqualsTo() {
TaskQueryFilterSpec filterSpec = new TaskQueryFilterSpecBuilder().equalsTo(TaskField.PROCESSID, "test-process").get();
QueryParam[] params = filterSpec.getParameters();
assertEquals(1, params.length);
QueryParam param = params[0];
assertEquals(TaskField.PROCESSID.toString(), param.getColumn());
assertEquals("EQUALS_TO", param.getOperator());
assertEquals("test-process", param.getValue().stream().findFirst().get());
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Test
public void testGetEqualsTo() {
ProcessInstanceQueryFilterSpec filterSpec = new ProcessInstanceQueryFilterSpecBuilder().equalsTo(ProcessInstanceField.PROCESSID, "test-process").get();
QueryParam[] params = filterSpec.getParameters();
assertEquals(1, params.length);
QueryParam param = params[0];
assertEquals(ProcessInstanceField.PROCESSID.toString(), param.getColumn());
assertEquals("EQUALS_TO", param.getOperator());
assertEquals("test-process", param.getValue().stream().findFirst().get());
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
assertEquals(TaskField.PROCESSID.toString(), paramEqualsTo.getColumn());
assertEquals("EQUALS_TO", paramEqualsTo.getOperator());
assertEquals("test-process", paramEqualsTo.getValue().stream().findFirst().get());
assertEquals(TaskField.CREATEDON.toString(), paramBetween.getColumn());
assertEquals("BETWEEN", paramBetween.getOperator());
List<?> values = paramBetween.getValue();
代码示例来源:origin: kiegroup/droolsjbpm-integration
assertEquals(ProcessInstanceField.PROCESSID.toString(), paramEqualsTo.getColumn());
assertEquals("EQUALS_TO", paramEqualsTo.getOperator());
assertEquals("test-process", paramEqualsTo.getValue().stream().findFirst().get());
assertEquals(ProcessInstanceField.START_DATE.toString(), paramBetween.getColumn());
assertEquals("BETWEEN", paramBetween.getOperator());
List<?> values = paramBetween.getValue();
代码示例来源:origin: org.kie.server/kie-server-services-jbpm
int index = 0;
for (org.kie.server.api.model.definition.QueryParam param : filterSpec.getParameters()) {
params[index] = new QueryParam(param.getColumn(), param.getOperator(), param.getValue());
index++;
代码示例来源:origin: org.kie.server/kie-server-services-jbpm-search
public <T> T getWithFilters(Integer page, Integer pageSize, QueryCallback queryCallback, RequestCallback reqCallback) {
QueryParam[] params = new QueryParam[0];
Map<String, String> columnMapping = null;
QueryContext queryContext = buildQueryContext(page, pageSize);
BaseQueryFilterSpec filterSpec = reqCallback.getQueryFilterSpec();
if (filterSpec != null) {
queryContext.setOrderBy(filterSpec.getOrderBy());
queryContext.setAscending(filterSpec.isAscending());
// build parameters for filtering the query
if (filterSpec.getParameters() != null) {
params = new QueryParam[filterSpec.getParameters().length];
int index = 0;
for (org.kie.server.api.model.definition.QueryParam param : filterSpec.getParameters()) {
params[index] = new QueryParam(param.getColumn(), param.getOperator(), param.getValue());
index++;
}
}
}
QueryResultMapper<?> resultMapper = QueryMapperRegistry.get().mapperFor(queryCallback.getMapperName(), columnMapping);
logger.debug("About to perform query '{}' with page {} and page size {}", queryCallback.getQueryName(), page, pageSize);
Object result = queryService.query(queryCallback.getQueryName(), resultMapper, queryContext, params);
logger.debug("Result returned from the query {} mapped with {}", result, resultMapper);
return (T) transform(result, resultMapper);
}
内容来源于网络,如有侵权,请联系作者删除!