當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelQuery類代碼示例

本文整理匯總了Java中org.activiti.engine.repository.ModelQuery的典型用法代碼示例。如果您正苦於以下問題:Java ModelQuery類的具體用法?Java ModelQuery怎麽用?Java ModelQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ModelQuery類屬於org.activiti.engine.repository包,在下文中一共展示了ModelQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getModelList

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public List<Model> getModelList(QueryCondition condition, PageInfo pageInfo) {
    String name = null;
    if (condition != null)
        name = condition.getConditionMap().get("name").toString();
    List<Model> modelList;
    long count;
    ModelQuery query = repositoryService.createModelQuery();
    if (!StrUtil.isEmpty(name)) {
        query = query.modelNameLike(name);
    }
    count = query.count();
    modelList = query.orderByCreateTime().desc().listPage((pageInfo.getPageNum() - 1) * pageInfo.getPageSize(), pageInfo.getPageSize());
    pageInfo.setCount((int) count);
    return modelList;
}
 
開發者ID:bill1012,項目名稱:AdminEAP,代碼行數:17,代碼來源:RepositoryPageServiceImpl.java

示例2: testByLatestVersion

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testByLatestVersion() {
  ModelQuery query = repositoryService.createModelQuery().latestVersion().modelKey("someKey");
  Model model = query.singleResult();
  assertNotNull(model);
  
  // Add a new version of the model
  Model newVersion = repositoryService.newModel();
  newVersion.setName("my model");
  newVersion.setKey("someKey");
  newVersion.setCategory("test");
  newVersion.setVersion(model.getVersion() + 1);
  repositoryService.saveModel(newVersion);
  
  // Verify query
  model = query.singleResult();
  assertNotNull(model);
  assertTrue(model.getVersion() == 2);
  
  // Cleanup
  repositoryService.deleteModel(model.getId());
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:22,代碼來源:ModelQueryTest.java

示例3: modelList

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
/**
 * 流程模型列表
 */
public Page<org.activiti.engine.repository.Model> modelList(Page<org.activiti.engine.repository.Model> page, String category) {

	ModelQuery modelQuery = repositoryService.createModelQuery().latestVersion().orderByLastUpdateTime().desc();
	
	if (StringUtils.isNotEmpty(category)){
		modelQuery.modelCategory(category);
	}
	
	page.setCount(modelQuery.count());
	page.setList(modelQuery.listPage(page.getFirstResult(), page.getMaxResults()));

	return page;
}
 
開發者ID:EleTeam,項目名稱:Shop-for-JavaWeb,代碼行數:17,代碼來源:ActModelService.java

示例4: modelKey

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelKey(String key) {
    if (key == null) {
        throw new ActivitiIllegalArgumentException("key is null");
    }
    this.key = key;
    return this;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:ModelQueryImpl.java

示例5: notDeployed

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery notDeployed() {
    if (deployed) {
        throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
    }
    this.notDeployed = true;
    return this;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:ModelQueryImpl.java

示例6: deployed

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery deployed() {
    if (notDeployed) {
        throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
    }
    this.deployed = true;
    return this;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:ModelQueryImpl.java

示例7: modelTenantId

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelTenantId(String tenantId) {
    if (tenantId == null) {
        throw new ActivitiIllegalArgumentException("Model tenant id is null");
    }
    this.tenantId = tenantId;
    return this;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:ModelQueryImpl.java

示例8: modelTenantIdLike

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
@Override
public ModelQuery modelTenantIdLike(String tenantIdLike) {
    if (tenantIdLike == null) {
        throw new ActivitiIllegalArgumentException("Model tenant id is null");
    }
    this.tenantIdLike = tenantIdLike;
    return this;
}
 
開發者ID:flowable,項目名稱:flowable-engine,代碼行數:9,代碼來源:ModelQueryImpl.java

示例9: modelList

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
/**
 * 模型列表
 */
@RequestMapping(value = {"", "list"})
public ModelAndView modelList(HttpServletRequest request) {
    ModelAndView mav = new ModelAndView("chapter20/model-list");

    Page<Model> page = new Page<Model>(PageUtil.PAGE_SIZE);
    int[] pageParams = PageUtil.init(page, request);

    ModelQuery modelQuery = repositoryService.createModelQuery();
    List<Model> list = modelQuery.listPage(pageParams[0], pageParams[1]);
    page.setResult(list);
    page.setTotalCount(modelQuery.count());
    mav.addObject("page", page);
    return mav;
}
 
開發者ID:shawn-gogh,項目名稱:myjavacode,代碼行數:18,代碼來源:ModelController.java

示例10: modelKey

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery modelKey(String key) {
  if (key == null) {
    throw new ActivitiIllegalArgumentException("key is null");
  }
  this.key = key;
  return this;
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:8,代碼來源:ModelQueryImpl.java

示例11: notDeployed

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery notDeployed() {
  if (deployed == true) {
    throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
  }
  this.notDeployed = true;
  return this;
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:8,代碼來源:ModelQueryImpl.java

示例12: deployed

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public ModelQuery deployed() {
  if (notDeployed == true) {
    throw new ActivitiIllegalArgumentException("Invalid usage: cannot use deployed() and notDeployed() in the same query");
  }
  this.deployed = true;
  return this;
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:8,代碼來源:ModelQueryImpl.java

示例13: testModelProperties

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testModelProperties() {
  ModelQuery query = repositoryService.createModelQuery();
  Model model = query.singleResult();
  assertNotNull(model.getId());
  assertNotNull(model.getCategory());
  assertNotNull(model.getKey());
  assertNotNull(model.getName());
  assertNotNull(model.getVersion());
  assertNotNull(model.getCreateTime());
  assertNotNull(model.getLastUpdateTime());
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:12,代碼來源:ModelQueryTest.java

示例14: testQueryByName

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testQueryByName() throws Exception {
  ModelQuery query = repositoryService.createModelQuery().modelName("my model");
  Model model = query.singleResult();
  assertNotNull(model);
  assertEquals("bytes", new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
  assertEquals(1, query.list().size());
  assertEquals(1, query.count());
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:9,代碼來源:ModelQueryTest.java

示例15: testQueryByNameLike

import org.activiti.engine.repository.ModelQuery; //導入依賴的package包/類
public void testQueryByNameLike() throws Exception {
  ModelQuery query = repositoryService.createModelQuery().modelNameLike("%model%");
  Model model = query.singleResult();
  assertNotNull(model);
  assertEquals("bytes", new String(repositoryService.getModelEditorSource(model.getId()), "utf-8"));
  assertEquals(1, query.list().size());
  assertEquals(1, query.count());
}
 
開發者ID:springvelocity,項目名稱:xbpm5,代碼行數:9,代碼來源:ModelQueryTest.java


注:本文中的org.activiti.engine.repository.ModelQuery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。