码上敲享录 > mongoDB常见问题解答 > java.lang.IllegalArgumentException: Owning type must not be null!

java.lang.IllegalArgumentException: Owning type must not be null!

上一章章节目录下一章 2019-12-19已有1355人阅读 评论(0)

java.lang.IllegalArgumentException: Owning type must not be null!


解决方法:

MongoRepository使用@Query查询语句时报错,原来是setting中的属性title不存在


@Component

public interface QuestionDao extends MongoRepository<Question,String> {

   @Query(value="{'$and': [{ 'surveyId':?0},{'setting.title':?1}]}",fields="{ '_id' : 1}")

   public List<Question> getQuestionListBySurveyIdAndOptLimit(Long surveyId,String title);

}


向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交