cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

5.7 -unable to fetch data through Java application,able to get from HAC using groovy

0 Likes
355
final Map params = new HashMap();
params.put("warehousecode", warehousemodel.getCode());
params.put("version", version);
params.put("catalog", catalog);
final FlexibleSearchQuery searchQuery = new FlexibleSearchQuery(
config.getConfiguration().getString("query", ""), params);
final List resultClassList = new ArrayList<Class>();
resultClassList.add(String.class);
resultClassList.add(String.class);
resultClassList.add(Integer.class);
resultClassList.add(Integer.class);
resultClassList.add(Integer.class);
resultClassList.add(Integer.class);
resultClassList.add(String.class);
searchQuery.setResultClassList(resultClassList);
final SearchResult<List> result = flexibleSearchService.search(searchQuery);
if (result.getTotalCount() > 0)


the below is the result :
--------------------------
result.getTotalCount() is returning  zero when made a call using the above code from java and returns  value when made a call from hac using query,groovy using the above code.

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

abderzakeboufeta
Explorer
0 Likes

Hard to tell without the query and more context. Could that be that restrictions apply to your query? from the HAC, choose the appropriate user and run the query as this user (instead of the default admin user). Tell us what you get.

0 Likes

select {p.code}, {sl.available}, {sl.commitedQty}, {sl.threshold}, ({sl.available}-{sl.commitedQty}), {p.pgroup} from { stocklevel as sl join warehouse as w on {sl.warehouse}={w.pk} and {w.code}=?warehousepk join product as p on {sl.productcode} ={p.code} and {p.code} not like 'DPP%' join catalogversion as catv on {p.catalogVersion} = {catv.pk} and {catv.version}=?version join catalog as cat on {catv.catalog} = {cat.pk} and {cat.id}=?catalog }

I am querying product and stock information of the product where , I am unable to get that from java code .

Got values from hac using admin user.

will try and get back to you querying from hac with a different user