Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

JPA type casting



Hello,

I am writing a jpa query which involves comparing 2 parameters code1 and code2. however, code1 is a string while code2 is an integer. i tried doing cast(code2 as string) but it's not working. I think it's because cast( something as Type) is supported in hibernate but not in jpa, so in jpa queries, how do you do type casting? Thanks so much.

j