private List<Meta> find(final Collection<Condition> conditions,
                            final Collection<OrderField<?>> orderFields,
                            final int offset,
                            final int numberOfRows,
                            final Set<Integer> usedValKeys) {

        return JooqUtil.contextResult(
                        metaDbConnProvider,
                        context -> {
                            final var select = metaExpressionMapper.addJoins(
                                            context
                                                    .selectDistinct(
                                                            meta.ID,
                                                            metaFeed.NAME,
                                                            metaType.NAME,
                                                            metaProcessor.PROCESSOR_UUID,
                                                            metaProcessor.PIPELINE_UUID,
                                                            meta.PARENT_ID,
                                                            meta.STATUS,
                                                            meta.STATUS_TIME,
                                                            meta.CREATE_TIME,
                                                            meta.EFFECTIVE_TIME,
                                                            meta.PROCESSOR_FILTER_ID,
                                                            meta.PROCESSOR_TASK_ID
                                                    )
                                                    .from(meta)
                                                    .straightJoin(metaFeed).on(meta.FEED_ID.eq(metaFeed.ID))
                                                    .straightJoin(metaType).on(meta.TYPE_ID.eq(metaType.ID))
                                                    .leftOuterJoin(metaProcessor)
                                                    .on(meta.PROCESSOR_ID.eq(metaProcessor.ID)),
                                            meta.ID,
                                            usedValKeys)
                                    .where(conditions)
                                    .orderBy(orderFields)
                                    .limit(offset, numberOfRows);

                            LOGGER.debug("Find SQL:\n{}", select);

                            return select.fetch();
                        })
                .map(RECORD_TO_META_MAPPER::apply);
    }
@return True if any term in any rule expression uses at least one of {@code fields}.
stroom-meta/stroom-meta-impl-db/src/main/java/stroom/meta/impl/db/MetaDaoImpl.java