Search in sources :

Example 1 with QueryBuilder

use of org.infinispan.query.dsl.QueryBuilder in project indy by Commonjava.

the class FoloRecordCache method inProgressByTrackingKey.

private <R> R inProgressByTrackingKey(final TrackingKey key, final BiFunction<QueryBuilder, CacheHandle<TrackedContentEntry, TrackedContentEntry>, R> operation) {
    return inProgressRecordCache.execute((cache) -> {
        QueryFactory queryFactory = Search.getQueryFactory(cache);
        QueryBuilder qb = queryFactory.from(TrackedContentEntry.class).having("trackingKey.id").eq(key.getId()).toBuilder();
        return operation.apply(qb, inProgressRecordCache);
    });
}
Also used : QueryFactory(org.infinispan.query.dsl.QueryFactory) QueryBuilder(org.infinispan.query.dsl.QueryBuilder) TrackedContentEntry(org.commonjava.indy.folo.model.TrackedContentEntry)

Aggregations

TrackedContentEntry (org.commonjava.indy.folo.model.TrackedContentEntry)1 QueryBuilder (org.infinispan.query.dsl.QueryBuilder)1 QueryFactory (org.infinispan.query.dsl.QueryFactory)1