for (int i = 0; i < itemPkFields.length; i++)
{
jdbcTypes[pkFields.length + i] = itemPkFields[i].getJdbcType().getType();
}
ReportQueryByMtoNCriteria q = new ReportQueryByMtoNCriteria(getItemClassDescriptor().getClassOfObject(), cols,
crit, false);
q.setIndirectionTable(getCollectionDescriptor().getIndirectionTable());
q.setJdbcTypes(jdbcTypes);
CollectionDescriptor cds = getCollectionDescriptor();
//check if collection must be ordered
if (!cds.getOrderBy().isEmpty())
{
Iterator iter = cds.getOrderBy().iterator();
while (iter.hasNext())
{
q.addOrderBy((FieldHelper) iter.next());
}
}
return q;
}