on 08-02-2010 4:19 PM
hi experts
we develop a JSP application in MI 7.1, which works perfectly on a PDA, but when using the laptop client to get the following error:
"Query is not a Row Query"
As a tip, I copied the Quey in MaxDB and working properly
The code is :
SmartSyncQueryFactory queryFactory = SmartSyncRuntime.getInstance().getQueryFactory();
RowDescriptor rd = sbd.getTopRowDescriptor();
FieldDescriptor fd = rd.getFieldDescriptor(arrayHeaderFieldNames[sortIndex]);
SortOrder singleSortOrder = queryFactory.createSortOrder(fd, sortOrder);
Query syncBoQuery = queryFactory.createQuery(sbd, singleSortOrder, start, count);
// iteratorSyncBos = dataFacade.getSyncBos(syncBoQuery).iterator();
try {
RowList lv_rows = dataFacade.getRows(syncBoQuery);< -
if (lv_rows.size() != 0) {
iteratorRows = lv_rows.iterator();
intRowInstancesCount = lv_rows.size();
}else{
intRowInstancesCount = 0;
}
} catch (Exception e) {
// TODO: handle exception
}
any ideas?
HI,
Could you please check the same with the below piece of code :
public MeIterator getRowInstances(String syncBoName, int start, int count, int sortIndex, boolean sortOrder, String filter) {
try {
SyncBoDescriptor sbd = descriptorFacade.getSyncBoDescriptor(syncBoName);
MeIterator iteratorRows = null;
if (sortIndex < 0) {
// read all synbos if sortIndex = less 0. We use this path to get all syncbos and
// calulate how many syncbos/items are in the SB.
iteratorRows = dataFacade.getSyncBos(sbd).iterator();
} else {
// regular path. This path sets the sortorder and filter (if set)
SmartSyncQueryFactory queryFactory = SmartSyncRuntime.getInstance().getQueryFactory();
RowDescriptor rd = sbd.getTopRowDescriptor();
FieldDescriptor fd = rd.getFieldDescriptor(arrayHeaderFieldNames[sortIndex]);
// To create the proper filter condition we have to know the field type of the sortIndex field
// If it is a character field we use STARTS_WITH otherwise GREATER_THAN
BasisFieldType bft = fd.getFieldType();
RelationalOperatorType filterOperator;
if (bft == BasisFieldType.C) {
filterOperator = RelationalOperatorType.STARTS_WITH;
} else {
filterOperator = RelationalOperatorType.GREATER_THAN;
}
Condition cond = queryFactory.createCondition(fd, filterOperator, filter);
SortOrder singleSortOrder = queryFactory.createSortOrder(fd, sortOrder);
Query syncBoQuery = queryFactory.createQuery(rd, cond, singleSortOrder, start, count);
// iteratorSyncBos = dataFacade.getSyncBos(syncBoQuery).iterator();
iteratorRows = dataFacade.getRows(syncBoQuery).iterator();
}
return iteratorRows;
} catch (PersistenceException pex) {
System.out.println(pex.getMessage());
return null;
}
}
Thanks,
Swarna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.