Skip to content
Advertisement

Why Multiple Where Clause not Woking in nativeQuery

IT will gives error

But when we use single where clause its working

and my response is

But my problem is based on queryParm as userId we get data not all, so i added multiple where claues we get error please help me for that.

Advertisement

Answer

So AS you look at the error message it obviously said that the parameter userId was not found in the query. It’s because of your typo in the query:

+ "AND u.id =: userId")

it should be like:

+ "AND u.id = :userId")

Reading the error message always helps you with debugging.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement