{
ClassLoaderResolver clr=stmt.getClassLoaderResolver();
if (!clr.isAssignableFrom(keyType,filteredKeyType) &&
!clr.isAssignableFrom(filteredKeyType,keyType))
{
throw new IncompatibleQueryElementTypeException(keyType, filteredKeyType == null ? null : filteredKeyType.getName());
}
// Join the map table on the owner ID column (apply to any unions)
LogicSetExpression mapTblExpr = stmt.newTableExpression(mapTable, mapTableAlias);
ScalarExpression ownerMapExpr = this.ownerMapping.newScalarExpression(stmt,stmt.getTableExpression(mapTableAlias));