@Override
    public List<SimpleMeta> findBatch(final long minId,
                                      final Long maxId,
                                      final int batchSize) {

        LOGGER.debug("findBatch() - minId: {}, maxId: {}, batchSize: {}",
                minId, maxId, batchSize);

        if ((maxId != null && maxId < minId)
            || batchSize <= 0) {
            return Collections.emptyList();
        } else {
            final Collection<Condition> conditions = JooqUtil.conditions(
                    Optional.of(meta.ID.greaterOrEqual(minId)),
                    Optional.ofNullable(maxId)
                            .map(meta.ID::lessOrEqual));

            return JooqUtil.contextResult(metaDbConnProvider, context -> {
                var select = context
                        .select(SIMPLE_META_SELECT_FIELDS)
                        .from(meta)
                        .straightJoin(metaType).on(meta.TYPE_ID.eq(metaType.ID))
                        .straightJoin(metaFeed).on(meta.FEED_ID.eq(metaFeed.ID))
                        .where(conditions)
                        .orderBy(meta.ID)
                        .limit(batchSize);

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

                return select.fetch(this::mapToSimpleMeta);
            });
        }
    }
@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