获得" null"当试图访问mybatis mapper xml中的对象变量时

时间:2015-04-30 09:27:25

标签: java xml orm mybatis ibatis

public interface RawProductEvaluationEventDao 
{

public List<ProductEvaluationEvent> getEventsByTypeAndProductEvaluation(
        @Param("evaluation") ProductEvaluation evaluation,
        @Param("eventType") EventType eventType);
}

这是我的mapper xml RawProductEvaluationEventDao.xml

<select id="getEventsByTypeAndProductEvaluation" resultType="ProductEvaluationEvent">
    SELECT
    id, 
    productEvaluationFk, 
    eventTimestamp,
    receiptEventTypeFk,
    isStartEvent,
    isSuccess,
    supplementalEventText,
    exceptionStackTraceText
    FROM
    productEvaluationEvent
    WHERE productEvaluationFk = #{evaluation.id}
    AND receiptEventTypeFk = #{eventType.id}
</select>

我添加了记录器,发现我为evaluate.id&amp; eventType.id

14:47:39 DEBUG c.r.w.p.d.r.R.getEventsByTypeAndProductEvaluation - ==>  Preparing: SELECT id, productEvaluationFk, eventTimestamp, receiptEventTypeFk, isStartEvent, isSuccess, supplementalEventText, exceptionStackTraceText FROM productEvaluationEvent WHERE productEvaluationFk = ? AND receiptEventTypeFk = ? 
14:47:39 DEBUG c.r.w.p.d.r.R.getEventsByTypeAndProductEvaluation - ==>   Parameters: null, null

0 个答案:

没有答案