IntelliJ, Spring. Query is correct, but marked red underline

Answered

Hello.

Test code:

@Repository
public interface DAO extends JpaRepository<Book, Long>
{
@Query("SELECT b FROM Book AS b WHERE b.title LIKE %:substring%")
Page<Book> searchByTitle(@Param("substring") String substring, Pageable pageable);
}

The Query is being processed correctly, but 

%:substring%

marked red underline in editor space. And reason is:

'?' expected, got ':'

 

See screenrecord https://youtu.be/_wM-9bXkxPg 

 

--

IntelliJ IDEA 2017.2.5
Build #IU-172.4343.14, built on September 26, 2017
Licensed to Aleksey Baranov
You have a perpetual fallback license for this version
Subscription is active until September 8, 2018
JRE: 1.8.0_152-release-915-b12 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.6

0
2 comments

I couldn't create a User Parameter pattern (Properties | Tools | Database | User Parameters) for the 

%:substring%"

parameter to be parsed correctly. Could you please file an issue in YouTrack. Thank you.

0

Please sign in to leave a comment.