jpa语句报 org.springframework.dao.InvalidDataAccessApiUsageException: Parameter with that position [2] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that position
@Query("SELECT area from Area AS area WHERE area.state=0 AND area.name like %?1% ")
Area findByIsCityAndNameLike(int iscity,String name);
第一反应: 将 AND area.name like %?1% 后的 1要改成2 但是依然报错
仔细反应了 @Query("SELECT area from Area AS area WHERE area.state=0 AND area.isCity = ?1 AND area.name like %?2% ") 就正确了
jpa语句报 org.springframework.dao.InvalidDataAccessApiUsageException: Parameter with that position [2] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that position的更多相关文章
- org.springframework.dao.InvalidDataAccessApiUsageException: The given id must not be null!; nested exception is java.lang.IllegalArgumentException: The given id must not be null
通过这个简单的案例,手把手教给你分析异常信息(适合初学者看) org.springframework.dao.InvalidDataAccessApiUsageException: The given ...
- org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案
1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist ...
- IDEA报错: Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.url' in value "${spring.datasource.url}"
运行审核流模块: 在ActivitiServiceApplication模块日志报错: Error starting ApplicationContext. To display the auto-c ...
- MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
错误源自使用了这个例子:http://www.yihaomen.com/article/java/336.htm,如果运行时会出现如下错误: Invocation of init method fai ...
- spring报nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected错误
http://www.oschina.net/question/1539472_159699
- spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes
spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...
- spring boot配置spring-data-jpa的时候报错CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError
org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager f ...
- spring和mybatis整合报错:org.springframework.beans.MethodInvocationException: Property 'dataSource' threw exception; nested exception is java.lang.NoClassDefFoundError
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyExceptio ...
- Springboot 上传报错: Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceede
Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The ...
随机推荐
- 代理模式及jdk动态代理原理
代理模式 :为其它对象提供代理,以控制对这个对象的访问. 代理模式的特征:代理类(proxyClass)与委托类(realClass)有同样的接口,代理类主要负责为委托类预处理消息.过滤消息.把消息转 ...
- [Scala] Scala基础知识
Object An object is a type of class that can have no more than one instance, known in object-oriente ...
- 使用github pages, hexo搭建个人博客教程
具体的原理性的东西就不说了直接上教程,怕等下自己忘了. 一. github 阶段 申请一个github 账号并成功登录进去. 创建一个名字为xxx.github.io的空项目. 二. hexo 阶段 ...
- Collection接口
Collection接口所定义的方法: clear:清空 retainAll 求一个Collection和另一个 Collection的交集. object[] toArray() 把里面的各个对象 ...
- c#.net 生成清晰缩略图
1 public void imgsize() 2 { 3 //本例中假定了两个变量: 4 5 String src = "c:/myImages/a.jpg"; //源图像文件的 ...
- java连接oracle范例
需要引用:ojdbc6.jar import java.sql.*; public class Main { static Connection conn; static Statement stat ...
- 前端开发必备!Emmet语法
使用方法 emmet的使用方法也非常简单,以sublime text为例,直接在编辑器中输入HTML或CSS的代码的缩写,然后按tab键就可以拓展为完整的代码片段.(如果与已有的快捷键有冲突的话,可以 ...
- linux启动和关闭
startup,startup mount,startup nomount之间的区别: STARTUP NOMOUNT选项:(读初始化参数文件,启动实例)STARTUP NOMOUNT选项启动实例,但 ...
- OC编程之道-创建对象之单例模式
一 何为单例singleton模式?(what) 保证一个类只有一个实例,并提供一个访问它的全局访问点. 二 何时使用单例模式?(where) 1类只能有一个实例,而且必须从一个为人熟知的访问点对其访 ...
- 技术架构:IBatisNet
--连接数据库框架 1 providers.config 提供配制 常用的数据库连接程序 的xml文件 2 SqlMap.xml SQL语句执行结果和实体对象之间的映射文 ...