}
}
// build table (local table)
EventTableFactory eventTableFactory;
CoercionDesc hashCoercionDesc;
CoercionDesc rangeCoercionDesc;
if (hashKeys.size() != 0 && rangeKeys.isEmpty())
{
String indexedProps[] = hashKeys.keySet().toArray(new String[hashKeys.keySet().size()]);
hashCoercionDesc = CoercionUtil.getCoercionTypesHash(viewableEventType, indexedProps, hashKeyList);
rangeCoercionDesc = new CoercionDesc(false, null);
if (hashKeys.size() == 1) {
if (!hashCoercionDesc.isCoerce()) {
eventTableFactory = new PropertyIndexedEventTableSingleFactory(0, viewableEventType, indexedProps[0], unique, null);
}
else {
eventTableFactory = new PropertyIndexedEventTableSingleCoerceAddFactory(0, viewableEventType, indexedProps[0], hashCoercionDesc.getCoercionTypes()[0]);
}
}
else {
if (!hashCoercionDesc.isCoerce()) {
eventTableFactory = new PropertyIndexedEventTableFactory(0, viewableEventType, indexedProps, unique, null);
}
else {
eventTableFactory = new PropertyIndexedEventTableCoerceAddFactory(0, viewableEventType, indexedProps, hashCoercionDesc.getCoercionTypes());
}
}
}
else if (hashKeys.isEmpty() && rangeKeys.isEmpty())
{
hashCoercionDesc = new CoercionDesc(false, null);
rangeCoercionDesc = new CoercionDesc(false, null);
if (joinPropDesc.getInKeywordSingleIndex() != null) {
eventTableFactory = new PropertyIndexedEventTableSingleFactory(0, viewableEventType, joinPropDesc.getInKeywordSingleIndex().getIndexedProp(), unique, null);
inKeywordSingleIdxKeys = joinPropDesc.getInKeywordSingleIndex().getExpressions();
}
else if (joinPropDesc.getInKeywordMultiIndex() != null) {
eventTableFactory = new PropertyIndexedEventTableSingleArrayFactory(0, viewableEventType, joinPropDesc.getInKeywordMultiIndex().getIndexedProp(), unique, null);
inKeywordMultiIdxKey = joinPropDesc.getInKeywordMultiIndex().getExpression();
}
else {
eventTableFactory = new UnindexedEventTableFactory(0);
}
}
else if (hashKeys.isEmpty() && rangeKeys.size() == 1)
{
String indexedProp = rangeKeys.keySet().iterator().next();
CoercionDesc coercionRangeTypes = CoercionUtil.getCoercionTypesRange(viewableEventType, rangeKeys, outerEventTypes);
if (!coercionRangeTypes.isCoerce()) {
eventTableFactory = new PropertySortedEventTableFactory(0, viewableEventType, indexedProp);
}
else {
eventTableFactory = new PropertySortedEventTableCoercedFactory(0, viewableEventType, indexedProp, coercionRangeTypes.getCoercionTypes()[0]);
}
hashCoercionDesc = new CoercionDesc(false, null);
rangeCoercionDesc = coercionRangeTypes;
}
else {
String[] indexedKeyProps = hashKeys.keySet().toArray(new String[hashKeys.keySet().size()]);
Class[] coercionKeyTypes = SubordPropUtil.getCoercionTypes(hashKeys.values());
String[] indexedRangeProps = rangeKeys.keySet().toArray(new String[rangeKeys.keySet().size()]);
CoercionDesc coercionRangeTypes = CoercionUtil.getCoercionTypesRange(viewableEventType, rangeKeys, outerEventTypes);
eventTableFactory = new PropertyCompositeEventTableFactory(0, viewableEventType, indexedKeyProps, coercionKeyTypes, indexedRangeProps, coercionRangeTypes.getCoercionTypes());
hashCoercionDesc = CoercionUtil.getCoercionTypesHash(viewableEventType, indexedKeyProps, hashKeyList);
rangeCoercionDesc = coercionRangeTypes;
}
SubordTableLookupStrategyFactory subqTableLookupStrategyFactory = SubordinateTableLookupStrategyUtil.getLookupStrategy(outerEventTypes,