@@ -0,0 +1,3283 @@
+package org.orienteer.bpm.camunda.handler;%0A%0Aimport com.orientechnologies.orient.core.metadata.schema.OType;%0Aimport org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity;%0Aimport org.camunda.bpm.engine.impl.db.ListQueryParameterObject;%0Aimport org.camunda.bpm.engine.runtime.CaseExecutionQuery;%0Aimport org.orienteer.bpm.camunda.OPersistenceSession;%0Aimport org.orienteer.core.util.OSchemaHelper;%0A%0Aimport java.util.List;%0A%0A/**%0A * Created by kir on 16.07.16.%0A */%0Apublic class CaseExecutionEntityHandler extends AbstractEntityHandler%3CCaseExecutionEntity%3E %7B%0A%0A    public static final String OCLASS_NAME = %22BPMCaseExecution%22;%0A%0A    public CaseExecutionEntityHandler() %7B%0A        super(OCLASS_NAME);%0A    %7D%0A%0A    @Override%0A    public void applySchema(OSchemaHelper helper) %7B%0A        super.applySchema(helper);%0A%0A        helper.oProperty(%22caseInstanceId%22, OType.STRING, 10)%0A                .oProperty(%22businessKey%22, OType.STRING, 20)%0A                .oProperty(%22caseDefinitionId%22, OType.STRING, 30)%0A                .oProperty(%22activityId%22, OType.STRING, 40)%0A                .oProperty(%22parentId%22, OType.STRING, 50)%0A                .oProperty(%22superCaseExecutionId%22, OType.STRING, 60)%0A                .oProperty(%22superExecutionId%22, OType.STRING, 70)%0A                .oProperty(%22state%22, OType.INTEGER, 80)%0A                .oProperty(%22previous%22, OType.INTEGER, 90)%0A                .oProperty(%22required%22, OType.BOOLEAN, 100);%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectCaseExecutionsByParentCaseExecutionId(OPersistenceSession session, final ListQueryParameterObject parameter) %7B%0A        return queryList(session, %22select from %22 + getSchemaClass() + %22 where parentId = ?%22, parameter.getParameter());%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectCaseExecutionsByCaseInstanceId(OPersistenceSession session, final ListQueryParameterObject parameter) %7B%0A        return queryList(session, %22select from %22 + getSchemaClass() + %22 where caseInstanceId = ?%22, parameter.getParameter());%0A    %7D%0A%0A    @Statement%0A    public String selectCaseInstanceIdsByCaseDefinitionId(OPersistenceSession session, final ListQueryParameterObject parameter) %7B%0A        return querySingle(session, %22select id from %22 + getSchemaClass() + %22 where caseDefinitionId = ? and parentId is null%22,%0A                parameter.getParameter()).toString();%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectSubCaseInstanceBySuperCaseExecutionId(OPersistenceSession session, final String parameter) %7B%0A        return queryList(session, %22select from %22 + getSchemaClass() + %22 where superCaseExecutionId = ?%22, parameter);%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectSubCaseInstanceBySuperExecutionId(OPersistenceSession session, final String parameter) %7B%0A        return queryList(session, %22select from %22 + getSchemaClass() + %22 where superExecutionId = ?%22, parameter);%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectCaseExecutionsByQueryCriteria(OPersistenceSession session, final CaseExecutionQuery query) %7B%0A        return query(session, query);%0A    %7D%0A%0A    @Statement%0A    public List%3CCaseExecutionEntity%3E selectCaseInstanceByQueryCriteria(OPersistenceSession session, final CaseExecutionQuery query) %7B%0A        return query(session, query);%0A    %7D%0A%7D%0A

add mapping for CaseExecution