I've some problem in my project, we use PostgreSQL and Hibernate as ORM. I want to perform search in my table for any column type (INTEGER, STRING, TEXT). Where are some problem with Hibernate, I know what I can execute for example LIKE operator on INTEGER type like this:
select * from Table1 where size::text like '%3';
But damn Hibernate takes ::TEXT as self parameter and throws exception. How I can avoid this error? Thanks.
Try doing:
cast(size as text)
It should help.
Use CAST:
select * from Table1 where CAST(size AS text) like '%3';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With