Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQL to HSQL - DetachedCriteria

 
s daniel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to convert this SQL statement into HSQL
(I tired following a few other threads but it didn't work.)



This is what I tired but didn't work

I get this error for Line A: The method in(String, Object[]) in the type Restrictions is not applicable for the arguments (String, int[])


I get this error for Line B: The method in(String, int[]) is undefined for the type Expression
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi s daniel ,

I think, while programming you are not checking api.

Following are signature of method in



You have to use array of Object.

So you can use :


That will solve the problem.
Same is the case for Expression

For more information Check this


Thanks

- Kuldeep
 
s daniel
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Thanks it worked!!

I converted my array into the one you suggested and it worked.

FROM:
int[] productIds = {10011, 10012, 10013, 10014};
TO:
Integer[] productIds = {10011, 10012, 10013, 10014};
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic