• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TablePage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.activiti.engine.management.TablePage的典型用法代码示例。如果您正苦于以下问题:Java TablePage类的具体用法?Java TablePage怎么用?Java TablePage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TablePage类属于org.activiti.engine.management包,在下文中一共展示了TablePage类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public TablePage getTablePage(TablePageQueryImpl tablePageQuery, int firstResult, int maxResults) {

    TablePage tablePage = new TablePage();

    @SuppressWarnings("rawtypes")
    List tableData = getDbSqlSession().getSqlSession()
            .selectList("selectTableData", tablePageQuery, new RowBounds(firstResult, maxResults));

    tablePage.setTableName(tablePageQuery.getTableName());
    tablePage.setTotal(getTableCount(tablePageQuery.getTableName()));
    tablePage.setRows((List<Map<String, Object>>) tableData);
    tablePage.setFirstResult(firstResult);

    return tablePage;
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:TableDataManager.java


示例2: index

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@RequestMapping("")
public ModelAndView index(@RequestParam(value = "tableName", required = false) String tableName, HttpServletRequest request) {
    ModelAndView mav = new ModelAndView("chapter14/database");

    // 读取表
    Map<String, Long> tableCount = managementService.getTableCount();
    mav.addObject("tableCount", tableCount);

    // 读取表记录
    if (StringUtils.isNotBlank(tableName)) {
        TableMetaData tableMetaData = managementService.getTableMetaData(tableName);
        mav.addObject("tableMetaData", tableMetaData);
        Page<Map<String, Object>> page = new Page<Map<String, Object>>(10);
        int[] pageParams = PageUtil.init(page, request);
        TablePage tablePages = managementService.createTablePageQuery().tableName(tableName).listPage(pageParams[0], pageParams[1]);

        page.setResult(tablePages.getRows());
        page.setTotalCount(tableCount.get(tableName));
        mav.addObject("page", page);
    }
    return mav;
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:23,代码来源:DatabaseController.java


示例3: getTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public TablePage getTablePage(TablePageQueryImpl tablePageQuery, int firstResult, int maxResults) {

   TablePage tablePage = new TablePage();

   List<Map<String, Object>> tableData = (List<Map<String, Object>>) getDbSqlSession()
     .getSqlSession()
     .selectList("selectTableData", tablePageQuery, new RowBounds(firstResult, maxResults));

   tablePage.setTableName(tablePageQuery.getTableName());
   tablePage.setTotal(getTableCount(tablePageQuery.getTableName()));
   tablePage.setRows(tableData);
   tablePage.setFirstResult(firstResult);
   
   return tablePage;
 }
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:17,代码来源:TableDataManager.java


示例4: testGetTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public void testGetTablePage() {
  List<String> taskIds = generateDummyTasks(20);
  
  TablePage tablePage = managementService.createTablePageQuery()
    .tableName("ACT_RU_TASK")
    .listPage(0, 5);
  
  assertEquals(0, tablePage.getFirstResult());
  assertEquals(5, tablePage.getSize());
  assertEquals(5, tablePage.getRows().size());
  assertEquals(20, tablePage.getTotal());
  
  tablePage = managementService.createTablePageQuery()
    .tableName("ACT_RU_TASK")
    .listPage(14, 10);
  
  assertEquals(14, tablePage.getFirstResult());
  assertEquals(6, tablePage.getSize());
  assertEquals(6, tablePage.getRows().size());
  assertEquals(20, tablePage.getTotal());

  taskService.deleteTasks(taskIds, true);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:24,代码来源:TablePageQueryTest.java


示例5: testGetSortedTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public void testGetSortedTablePage() {
  List<String> taskIds = generateDummyTasks(15);
  
  // With an ascending sort
  TablePage tablePage = managementService.createTablePageQuery()
    .tableName("ACT_RU_TASK")
    .orderAsc("NAME_")
    .listPage(1, 7);
  String[] expectedTaskNames = new String[] {"B", "C", "D", "E", "F", "G", "H"};
  verifyTaskNames(expectedTaskNames, tablePage.getRows());
  
  // With a descending sort
  tablePage = managementService.createTablePageQuery()
    .tableName("ACT_RU_TASK")
    .orderDesc("NAME_")
    .listPage(6, 8);
  expectedTaskNames = new String[] {"I", "H", "G", "F", "E", "D", "C", "B"} ;
  verifyTaskNames(expectedTaskNames, tablePage.getRows());
  
  taskService.deleteTasks(taskIds, true);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:22,代码来源:TablePageQueryTest.java


示例6: getTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public TablePage getTablePage(TablePageQueryImpl tablePageQuery, int firstResult, int maxResults) {

  TablePage tablePage = new TablePage();

  @SuppressWarnings("rawtypes")
  List tableData = getDbSqlSession().getSqlSession()
    .selectList("selectTableData", tablePageQuery, new RowBounds(firstResult, maxResults));

  tablePage.setTableName(tablePageQuery.getTableName());
  tablePage.setTotal(getTableCount(tablePageQuery.getTableName()));
  tablePage.setRows((List<Map<String,Object>>)tableData);
  tablePage.setFirstResult(firstResult);
  
  return tablePage;
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:17,代码来源:TableDataManager.java


示例7: testGetTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public void testGetTablePage() {
  String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
  List<String> taskIds = generateDummyTasks(20);
  
  TablePage tablePage = managementService.createTablePageQuery()
    .tableName(tablePrefix+"ACT_RU_TASK")
    .listPage(0, 5);
  
  assertEquals(0, tablePage.getFirstResult());
  assertEquals(5, tablePage.getSize());
  assertEquals(5, tablePage.getRows().size());
  assertEquals(20, tablePage.getTotal());
  
  tablePage = managementService.createTablePageQuery()
    .tableName(tablePrefix+"ACT_RU_TASK")
    .listPage(14, 10);
  
  assertEquals(14, tablePage.getFirstResult());
  assertEquals(6, tablePage.getSize());
  assertEquals(6, tablePage.getRows().size());
  assertEquals(20, tablePage.getTotal());

  taskService.deleteTasks(taskIds, true);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:25,代码来源:TablePageQueryTest.java


示例8: testGetSortedTablePage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public void testGetSortedTablePage() {
  String tablePrefix = processEngineConfiguration.getDatabaseTablePrefix();
  List<String> taskIds = generateDummyTasks(15);
  
  // With an ascending sort
  TablePage tablePage = managementService.createTablePageQuery()
    .tableName(tablePrefix+"ACT_RU_TASK")
    .orderAsc("NAME_")
    .listPage(1, 7);
  String[] expectedTaskNames = new String[] {"B", "C", "D", "E", "F", "G", "H"};
  verifyTaskNames(expectedTaskNames, tablePage.getRows());
  
  // With a descending sort
  tablePage = managementService.createTablePageQuery()
    .tableName(tablePrefix+"ACT_RU_TASK")
    .orderDesc("NAME_")
    .listPage(6, 8);
  expectedTaskNames = new String[] {"I", "H", "G", "F", "E", "D", "C", "B"} ;
  verifyTaskNames(expectedTaskNames, tablePage.getRows());
  
  taskService.deleteTasks(taskIds, true);
}
 
开发者ID:springvelocity,项目名称:xbpm5,代码行数:23,代码来源:TablePageQueryTest.java


示例9: test

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@Test
public void test() {
    List<Job> jobList = managementService.createJobQuery()
            .list();
    logger.info("###================================================ jobList, {}", jobList);

    TablePage tablePage = managementService.createTablePageQuery()
            .tableName("")
            .listPage(1, 10);
    logger.info("###================================================ tablePage, {}", tablePage);

    managementService.executeJob("");
    String exceptionStacktrace = managementService.getJobExceptionStacktrace("");
    logger.info("###================================================ exceptionStacktrace, {}", exceptionStacktrace);
}
 
开发者ID:Lzw2016,项目名称:study,代码行数:16,代码来源:ManagementServiceTest.java


示例10: index

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@RequestMapping("")
public ModelAndView index(@RequestParam(value = "tableName", required = false) String tableName, HttpServletRequest request) {
    ModelAndView mav = new ModelAndView("chapter14/database");

    // 读取表
    Map<String, Long> tableCountUnSort = managementService.getTableCount();
    Map<String, Long> tableCount = new TreeMap<String, Long>(tableCountUnSort);

    /*
    添加自定义的表
     */
    tableCount.put("AIA_C17_LEAVE", activitiDao.countTableRows("AIA_C17_LEAVE"));

    mav.addObject("tableCount", tableCount);

    // 读取表记录
    if (StringUtils.isNotBlank(tableName)) {
        TableMetaData tableMetaData = managementService.getTableMetaData(tableName);
        mav.addObject("tableMetaData", tableMetaData);
        Page<Map<String, Object>> page = new Page<Map<String, Object>>(10);
        int[] pageParams = PageUtil.init(page, request);
        TablePage tablePages = managementService.createTablePageQuery().tableName(tableName).listPage(pageParams[0], pageParams[1]);

        page.setResult(tablePages.getRows());
        page.setTotalCount(tableCount.get(tableName));
        mav.addObject("page", page);
    }
    return mav;
}
 
开发者ID:shawn-gogh,项目名称:myjavacode,代码行数:30,代码来源:DatabaseController.java


示例11: getTableData

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@Get
public ObjectNode getTableData() {
  if(authenticate(SecuredResource.ADMIN) == false) return null;
  
  String tableName = (String) getRequest().getAttributes().get("tableName");
  int start = RequestUtil.getInteger(getQuery(), "start", 0);
  int size = RequestUtil.getInteger(getQuery(), "size", 10);
  String order = getQuery().getValues("order");
  if(order == null) {
    order = "asc";
  }
  String sort = getQuery().getValues("sort");

  if (sort == null) {
    TableMetaData tmd = ActivitiUtil.getManagementService().getTableMetaData(tableName);
    List<String> columnNames = tmd.getColumnNames();
    if (columnNames.size() > 0) {
      sort = columnNames.get(0);
    }
    else {
      sort = null;
    }
  }

  TablePageQuery query = ActivitiUtil.getManagementService()
    .createTablePageQuery()
    .tableName(tableName);
  if (sort != null) {
    if (order.equals("asc")) {
      query.orderAsc(sort);
    }
    else {
      query.orderDesc(sort);
    }
  }

  TablePage tablePage = query.listPage(start, size);
  
  ObjectNode responseJSON = new ObjectMapper().createObjectNode();
  responseJSON.put("sort", sort);
  responseJSON.put("order", order);
  responseJSON.put("start", tablePage.getFirstResult());
  responseJSON.put("size", tablePage.getSize());
  responseJSON.put("total", tablePage.getTotal());
  
  ArrayNode tableArray = new ObjectMapper().createArrayNode();
  
  for (Map<String, Object> row : tablePage.getRows()) {
    ObjectNode columnJSON = new ObjectMapper().createObjectNode();
    for (String name : row.keySet()) {
      if(row.get(name) instanceof byte[]) {
        columnJSON.put(name, ((byte[]) row.get(name)).length);
      } else if(row.get(name) instanceof Date) {
        columnJSON.put(name, RequestUtil.dateToString((Date) row.get(name)));
      } else {
        columnJSON.put(name, row.get(name).toString());
      }
    }
    tableArray.add(columnJSON);
  }
  
  responseJSON.put("data", tableArray);
  
  return responseJSON;
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:66,代码来源:TableDataResource.java


示例12: listPage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@Override
public TablePage listPage(int firstResult, int maxResults) {
    this.firstResult = firstResult;
    this.maxResults = maxResults;
    return commandExecutor.execute(this);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:7,代码来源:TablePageQueryImpl.java


示例13: execute

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@Override
public TablePage execute(CommandContext commandContext) {
    return commandContext
            .getTableDataManager()
            .getTablePage(this, firstResult, maxResults);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:7,代码来源:TablePageQueryImpl.java


示例14: listPage

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public TablePage listPage(int firstResult, int maxResults) {
  this.firstResult = firstResult;
  this.maxResults = maxResults;
  return commandExecutor.execute(this);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:6,代码来源:TablePageQueryImpl.java


示例15: execute

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
public TablePage execute(CommandContext commandContext) {
  return commandContext
    .getTableDataManager()
    .getTablePage(this, firstResult, maxResults);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:6,代码来源:TablePageQueryImpl.java


示例16: getTableData

import org.activiti.engine.management.TablePage; //导入依赖的package包/类
@GET
@Path("/tables/{tableName}/data")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public DataResponse getTableData(@PathParam("tableName") String tableName) {

    Map<String,String> allRequestParams = new HashMap<>();
    // Check if table exists before continuing
    if (managementService.getTableMetaData(tableName) == null) {
        throw new ActivitiObjectNotFoundException("Could not find a table with name '" + tableName + "'.", String.class);
    }

    String orderAsc = uriInfo.getQueryParameters().getFirst("orderAscendingColumn");
    String orderDesc = uriInfo.getQueryParameters().getFirst("orderDescendingColumn");

    if (orderAsc != null && orderDesc != null) {
        throw new ActivitiIllegalArgumentException("Only one of 'orderAscendingColumn' or 'orderDescendingColumn' can be supplied.");
    }

    allRequestParams = Utils.prepareCommonParameters(allRequestParams, uriInfo);

    Integer start = null;
    if (allRequestParams.containsKey("start")) {
        start = Integer.valueOf(allRequestParams.get("start"));
    }

    if (start == null) {
        start = 0;
    }

    Integer size = null;
    if (allRequestParams.containsKey("size")) {
        size = Integer.valueOf(allRequestParams.get("size"));
    }

    if (size == null) {
        size = DEFAULT_RESULT_SIZE;
    }

    DataResponse response = new DataResponse();

    TablePageQuery tablePageQuery = managementService.createTablePageQuery().tableName(tableName);

    if (orderAsc != null) {
        allRequestParams.put("orderAscendingColumn", orderAsc);
        tablePageQuery.orderAsc(orderAsc);
        response.setOrder("asc");
        response.setSort(orderAsc);
    }

    if (orderDesc != null) {
        allRequestParams.put("orderDescendingColumn", orderDesc);
        tablePageQuery.orderDesc(orderDesc);
        response.setOrder("desc");
        response.setSort(orderDesc);
    }

    TablePage listPage = tablePageQuery.listPage(start, size);
    response.setSize(((Long) listPage.getSize()).intValue());
    response.setStart(((Long) listPage.getFirstResult()).intValue());
    response.setTotal(listPage.getTotal());
    response.setData((List)listPage.getRows());

    return response;
}
 
开发者ID:wso2,项目名称:carbon-business-process,代码行数:65,代码来源:ManagementService.java



注:本文中的org.activiti.engine.management.TablePage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StrMatcher类代码示例发布时间:2022-05-22
下一篇:
Java ZipResourceFile类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap