JNIEXPORT jlong JNICALL Java_io_realm_internal_TableView_nativeFindAllString(
    JNIEnv* env, jobject, jlong nativeViewPtr, jlong columnIndex, jstring value)
{
    try {
        if (!VIEW_VALID_AND_IN_SYNC(env, nativeViewPtr) ||
            !COL_INDEX_AND_TYPE_VALID(env, TV(nativeViewPtr), columnIndex, type_String))
            return 0;
        JStringAccessor value2(env, value); // throws
        TR("nativeFindAllString(col %" PRId64 ", string '%s') ", S64(columnIndex), StringData(value2).data())
        TableView* pResultView = new TableView( TV(nativeViewPtr)->find_all_string( S(columnIndex), value2) );
        TR("-- resultview size=%" PRId64 ".", S64(pResultView->size()))
        return reinterpret_cast<jlong>(pResultView);
    } CATCH_STD()
    return 0;
}
JNIEXPORT jlong JNICALL Java_io_realm_internal_TableView_nativeFindAllString(
    JNIEnv* env, jobject, jlong nativeViewPtr, jlong columnIndex, jstring value)
{
    TV(nativeViewPtr)->sync_if_needed();
    if (!VIEW_VALID(env, nativeViewPtr) ||
        !COL_INDEX_AND_TYPE_VALID(env, TV(nativeViewPtr), columnIndex, type_String))
        return 0;

    try {
        JStringAccessor value2(env, value); // throws
        TR((env, "nativeFindAllString(col %d, string '%s') ", columnIndex, StringData(value2).data()));
        TableView* pResultView = new TableView( TV(nativeViewPtr)->find_all_string( S(columnIndex), value2) );
        TR((env, "-- resultview size=%lld.\n", pResultView->size()));
        return reinterpret_cast<jlong>(pResultView);
    } CATCH_STD()
    return 0;
}