cancel
Showing results for 
Search instead for 
Did you mean: 

MI 7.1 - JSP application developer for PDA, running on laptop error

asdasd_asdasd
Active Participant
0 Kudos

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);< -


EXCEPTION

if (lv_rows.size() != 0) {

iteratorRows = lv_rows.iterator();

intRowInstancesCount = lv_rows.size();

}else{

intRowInstancesCount = 0;

}

} catch (Exception e) {

// TODO: handle exception

}

any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

asdasd_asdasd
Active Participant
0 Kudos

Thanks Swarna Shree, you solved my problem, but not very well understood that fails Quey, thank you very much!

Answers (0)