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% ") 就正确了
时间: 2024-09-29 18:49:11

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: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案

1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: detached entity passed to persist: sys.entity.Role at org.springframew

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 server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure

spring boot配置spring-data-jpa的时候报错CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.NoSuchMethodError

F:\java\jdk8\jdk1.8.0_211\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\软件\IntelliJ IDEA 2019.2.2\lib\idea_rt.jar=7513:D:\软件\IntelliJ IDEA 2019.2.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\软件\IntelliJ IDEA 2019.2.2

?--Porg.springframework.beans.MethodInvocationException: Property 'username' threw exception; nested exception is java.lang.NullPointerException

使用BoneCP作为连接池,在启动Tomcat报出以下异常: 一月 02, 2016 2:12:17 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:mynewdpi' did not find a

Java AOP nested exception is java.lang.NoClassDefFoundError: org/aopalliance/aop/Advice || Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' 两个异常解决办法

贴出applicationContext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://ww

Spring出现Unexpected exception parsing XML document from class path resource [applicationBeans.xml]; nested exception is java.lang.NoClassDefFoundError: org/springframework/aop/TargetSource异常

在自学Spring4的过程中,遇到了棘手的异常,一直找不到问题所在,后来经过对每个过程进行逐一排查之后,发现少了一个jar包:spring-aop-4.0.0.RELEASE.jar.完整的异常信息如下: Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from clas

java.lang.IllegalArgumentException: parameter must be a descendant of this view

异常信息: java.lang.IllegalArgumentException: parameter must be a descendant of this view 错误原因: 发生这个错误主要是ListView或者其它ViewGroup等容器控件因为滑动而暂时移除子View,但却没有移除该子View上面的焦点Focus,所以在ListView滑动返回到原来的位置的时候没有恢复成原来的View,导致了该异常的产生,具体的源码分析可以查看参考链接[2] 解决方法: 解决办法就是清除掉List

org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default constructor found; nested exception is java.lang.NoSuchMethodException: demo.Words.&lt;init&gt;()

org.springframework.beans.BeanInstantiationException: Failed to instantiate [demo.Words]: No default constructor found; nested exception is java.lang.NoSuchMethodException: demo.Words.<init>()或者是: org.springframework.beans.BeanInstantiationException

Failed to introspect bean class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClass

依赖引入  错误可能版本 不对 Failed to introspect bean class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for lookup method metadata: could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/hibernate/boot/m