/** * Creates a new Joiner based on the given index which backs a foreign-key * relationship. The table of the given index will be the "from" table and * the table on the other end of the relationship will be the "to" table. * * @param fromIndex the index backing one side of a foreign-key relationship */ public static Joiner create(Index fromIndex) throws IOException { Index toIndex = fromIndex.getReferencedIndex(); IndexCursor toCursor = CursorBuilder.createCursor(toIndex); // text lookups are always case-insensitive toCursor.setColumnMatcher(CaseInsensitiveColumnMatcher.INSTANCE); return new Joiner(fromIndex, toCursor); }