on 01-04-2016 2:13 PM
I am facing an issue which i execute below query through DAO can anybody help me please
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery( "SELECT {sicj.pk},{sicj.uid} FROM {user AS sicj JOIN wishlist2 AS sij ON {sicj:pk} = {sij:user} }");
Exception :
java.sql.SQLSyntaxErrorException: incompatible data type in conversion: from SQL type VARCHAR to java.lang.Long,
Hi,
The issue seems about how you are retrieving the results of the flexible search to your java Map, instead of expect a Long you should change per a String.
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Juan
I have not add any Long generic type for result set please find below code which I am working now
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(
"SELECT {sij.pk},{sicj.uid} FROM {user AS sicj JOIN wishlist2 AS sij ON {sicj.pk} = {sij.user} }");
fQuery.setResultClassList(Arrays.asList(String.class, WishlistUserModel.class));
final SearchResult rs = (SearchResult) flexibleSearchService.search(fQuery).getResult();
System.out.println("Final result" + rs);
Hi,
I think the issue is on this line
fQuery.setResultClassList(Arrays.asList(String.class, WishlistUserModel.class));
{sicj.uid} can not be cast to WishlistUserModel you should return on the query {sicj.pk} or change WishlistUserModel per String.class
Regards
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.