Class syntheticPredicateSubjectClass = loader.loadClass(predicateSubjectClass.getName());
SyntheticSubject syntheticSubject = new SyntheticSubject(context, loader,syntheticPredicateSubjectClass);
Class syntheticPredicateClass = loader.loadClass(predicate.getClass().getName());
Predicate syntheticPredicate = (Predicate) instantiateSyntheticPredicate(session, predicate, syntheticPredicateClass);// (Predicate)syntheticPredicateClass.newInstance();
Comparator syntheticComparator = null;
if(comparator!=null){
Class syntheticComparatorClass = loader.loadClass(comparator.getClass().getName());
syntheticComparator = (Comparator) instantiateSyntheticPredicate(session, comparator, syntheticComparatorClass);
//(Comparator) session.getDescriptorForClass(syntheticComparatorClass).newInstance();
}
//int[] predicateSubjectFields = loader.getPredicateSubjectFields();
JODBIndexingRootAgent indexingRootAgent = session.getIndexingRootAgent();
JODBIndexingAgent indexingAgent = null;
Iterator<Integer> predicateSubjectAccessedFields = loader.getAccessedPredicateSubjectFields();
while (predicateSubjectAccessedFields.hasNext() && indexingAgent == null) {
indexingAgent = indexingRootAgent.getIndexingAgent(predicateSubjectAccessedFields.next(), session.getBase());
}
ByteBuffer indexDataBuffer = null;
int indexField = -1;
IndexDataIterator indexIterator = null;
if(indexingAgent!=null){
indexField = indexingAgent.getFieldId();
indexDataBuffer = ByteBuffer.allocate(16);
indexIterator = indexingAgent.getIndexIterator(true);
}
if(indexIterator==null){
indexIterator = new LArrayIndexIterator(base.getForAllObjects(ticket));
}
SyntheticSubject syntheticSubjectPrev = null;
COMPARISON_STATE comparison_state= COMPARISON_STATE.UNKNOWN;
LArrayChunkedBuffer acceptedIdsBuffer = new LArrayChunkedBuffer();
while (indexIterator.hasNext()) {
if(indexDataBuffer != null){
indexDataBuffer.clear();
}
long nextObjectId = indexIterator.next(indexDataBuffer);
if(!syntheticSubject.setObjectData(nextObjectId, indexField, indexDataBuffer)){
continue;
}
if(!syntheticPredicate.match(syntheticSubject._syntheticSubject)){
continue;
}
acceptedIdsBuffer.add(nextObjectId);
if(syntheticComparator!=null && comparison_state!=COMPARISON_STATE.MIXED){
if(syntheticSubjectPrev!=null ){