This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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