Reputation: 599
I have a sql query which works fine on sql server query window and returns results
sql query:
select * from table1 where title = N'تست'
if I put that 'N' in my query in sql, the query gets results and if I don't put 'N' no results will be returned.
the question is how can I have this query in jpql format (with that 'N')?
thanks for replying
Upvotes: 1
Views: 231
Reputation: 153780
Try setting this Hibernate property:
hibernate.connection.defaultNChar=true
If you use an external DataSource (external connection pool like HikariCP) then you want to set the following property in the JDBC connection URL:
sendStringParametersAsUnicode=true
Upvotes: 1