Activiti中TaskQueryImpl时不时报错,重启服务就好了,这个是什么问题

酱油水笔 发布于 2015/06/30 17:50
阅读 1K+
收藏 0

解读下一代网络:算力网络正从理想照进现实!>>>

Error querying database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.TaskQueryImpl'
### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'limitBefore' in 'class org.activiti.engine.impl.TaskQueryImpl'
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
at org.activiti.engine.impl.db.DbSqlSession.selectListWithRawParameter(DbSqlSession.java:286)
at org.activiti.engine.impl.db.DbSqlSession.selectList(DbSqlSession.java:277)
at org.activiti.engine.impl.persistence.entity.TaskEntityManager.findTasksByQueryCriteria(TaskEntityManager.java:113)
at org.activiti.engine.impl.TaskQueryImpl.executeList(TaskQueryImpl.java:551)
at org.activiti.engine.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:158)
at org.activiti.engine.impl.AbstractQuery.execute(AbstractQuery.java:141)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.AbstractQuery.singleResult(AbstractQuery.java:104)
加载中
0
包子界权威
包子界权威

我也遇到了,怎么解决的????

0
包子界权威
包子界权威
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.activiti.engine.impl.db;


/**
 * @author Daniel Meyer
 */
public class ListQueryParameterObject {

    protected int maxResults = Integer.MAX_VALUE;
    protected int firstResult = 0;
    protected Object parameter;
    protected String databaseType;

    public ListQueryParameterObject() {
    }

    public ListQueryParameterObject(Object parameter, int firstResult, int maxResults) {
        this.parameter = parameter;
        this.firstResult = firstResult;
        this.maxResults = maxResults;
    }

    public int getFirstResult() {
        return firstResult;
    }

    public int getFirstRow() {
        return firstResult +1;
    }

    public int getLastRow() {
        if(maxResults == Integer.MAX_VALUE) {
            return maxResults;
        }
        return  firstResult + maxResults + 1;
    }

    public int getMaxResults() {
        return maxResults;
    }

    public Object getParameter() {
        return parameter;
    }

    public void setFirstResult(int firstResult) {
        this.firstResult = firstResult;
    }

    public void setMaxResults(int maxResults) {
        this.maxResults = maxResults;
    }

    public void setParameter(Object parameter) {
        this.parameter = parameter;
    }

    public String getOrderBy() {
        // the default order column
        return "RES.ID_ asc";
    }

    public String getOrderByColumns() {
        return getOrderBy();
    }

    public void setDatabaseType(String databaseType) {
        this.databaseType = databaseType;
    }

    public String getDatabaseType() {
        return databaseType;
    }

    public String getLimitBefore() {return "";}
    public void setLimitBefore(String limitBefore) {}

}

 

再自己项目里创建一个上述的类,问题解决

返回顶部
顶部