File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes SQL to HSQL - DetachedCriteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "SQL to HSQL - DetachedCriteria" Watch "SQL to HSQL - DetachedCriteria" New topic
Author

SQL to HSQL - DetachedCriteria

s daniel
Greenhorn

Joined: Nov 03, 2008
Posts: 9
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

Joined: Jul 30, 2008
Posts: 162

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

Joined: Nov 03, 2008
Posts: 9
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};
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL to HSQL - DetachedCriteria
 
Similar Threads
hitsofweb
Sorting results by column in Hibernate
isNotNull & isNotEmpty Hibernate
HQL Query return type
error while mapping to child table directly