AnsweredAssumed Answered

in Job.xml,missing ${prefix} before  ACT_RE_PROCDEF

Question asked by classfoo on Sep 16, 2015
Latest reply on Sep 17, 2015 by vasile.dirla
in Job.xml,missing ${prefix} before  ACT_RE_PROCDEF

  <select id="selectJobByTypeAndProcessDefinitionKeyNoTenantId" parameterType="org.activiti.engine.impl.db.ListQueryParameterObject" resultMap="jobResultMap">
    select J.*
    from ${prefix}ACT_RU_JOB J
    inner join ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_
    where J.HANDLER_TYPE_ = #{parameter.handlerType}
    and P.KEY_ = #{parameter.processDefinitionKey}
    and (P.TENANT_ID_ = ''  or P.TENANT_ID_ is null) 
  </select>
 
  <select id="selectJobByTypeAndProcessDefinitionKeyAndTenantId" parameterType="org.activiti.engine.impl.db.ListQueryParameterObject" resultMap="jobResultMap">
    select J.*
    from ${prefix}ACT_RU_JOB J
    inner join ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_
    where J.HANDLER_TYPE_ = #{parameter.handlerType}
    and P.KEY_ = #{parameter.processDefinitionKey}
    and P.TENANT_ID_ = #{parameter.tenantId}
  </select>

this cause startup with prefix failed:

Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'succezbi.act_re_procdef' doesn't exist
### The error may exist in org/activiti/db/mapping/entity/Job.xml
### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.selectJobByTypeAndProcessDefinitionKeyNoTenantId-Inline
### The error occurred while setting parameters
### SQL: select J.*     from SZSYS_1_ACT_RU_JOB J     inner join ACT_RE_PROCDEF P on J.PROC_DEF_ID_ = P.ID_     where J.HANDLER_TYPE_ = ?      and P.KEY_ = ?     and (P.TENANT_ID_ = ''  or P.TENANT_ID_ is null)
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'succezbi.act_re_procdef' doesn't exist
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23) ~[mybatis-3.2.5.jar:3.2.5]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107) ~[mybatis-3.2.5.jar:3.2.5]
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) ~[mybatis-3.2.5.jar:3.2.5]
   at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:435) ~[activiti-engine-5.18.0.jar:5.18.0]
   at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:426) ~[activiti-engine-5.18.0.jar:5.18.0]

Outcomes