Skip to content

JPA backslash/escape double quote regression in 2.6.5 #30576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brandonfl opened this issue Apr 7, 2022 · 1 comment
Closed

JPA backslash/escape double quote regression in 2.6.5 #30576

brandonfl opened this issue Apr 7, 2022 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@brandonfl
Copy link

brandonfl commented Apr 7, 2022

Hello,

Previous Spring boot version : 2.6.4
New Spring version : 2.6.5
Dependency : spring-boot-starter-data-jpa

When trying to update Spring Boot I get this new erreor :

org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [\] did not match expected type [java.lang.String (n/a)]; nested exception is java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)]
	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:374) ~[spring-orm-5.3.17.jar:5.3.17]
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:235) ~[spring-orm-5.3.17.jar:5.3.17]
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:551) ~[spring-orm-5.3.17.jar:5.3.17]
	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61) ~[spring-tx-5.3.17.jar:5.3.17]
	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242) ~[spring-tx-5.3.17.jar:5.3.17]
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152) ~[spring-tx-5.3.17.jar:5.3.17]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.17.jar:5.3.17]
	at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145) ~[spring-data-jpa-2.6.3.jar:2.6.3]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.17.jar:5.3.17]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.17.jar:5.3.17]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.17.jar:5.3.17]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.17.jar:5.3.17]
	at com.sun.proxy.$Proxy208.findAllByJsonNameContaining(Unknown Source) ~[na:na]

It's currently not possible to use \" into JPA. As for example :

List<TestEntity> testEntities = testRepository
        .findAllByJsonNameContaining("\"fr\":\"test\"");

For more info, here is the repository :

public interface TestRepository extends JpaRepository<TestEntity, Long>,
        JpaSpecificationExecutor<TestEntity> {

    List<TestEntity> findAllByJsonNameContaining(String jsonName);
}

I also tryed with multiple backslash as \\\" but I still have the same error...

Thanks in advance for the response 😄

@wilkinsona
Copy link
Member

Duplicates #30421.

@wilkinsona wilkinsona added the status: duplicate A duplicate of another issue label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants