All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kenshoo.pl.entity.FluentEntitiesFetcher Maven / Gradle / Ivy

Go to download

A Java persistence layer based on JOOQ for high performance and business flow support.

There is a newer version: 0.1.121-jooq-3.16.3
Show newest version
package com.kenshoo.pl.entity;

import com.kenshoo.pl.entity.internal.EntitiesFetcher;

import java.util.Collection;
import java.util.List;

import static java.util.Objects.requireNonNull;

class FluentEntitiesFetcher implements FetchFromStep, FetchWhereStep, FetchFinalStep {

    private final EntitiesFetcher entitiesFetcher;
    private final EntityField[] fieldsToFetch;
    private EntityType entityType;
    private PLCondition condition = PLCondition.trueCondition();


    FluentEntitiesFetcher(final EntitiesFetcher entitiesFetcher,
                          final EntityField... fieldsToFetch) {
        this.entitiesFetcher = requireNonNull(entitiesFetcher, "entitiesFetcher is required");
        this.fieldsToFetch = fieldsToFetch;
    }

    public FetchWhereStep from(final EntityType entityType) {
        this.entityType = entityType;
        return this;
    }

    public FetchFinalStep where(final PLCondition condition) {
        this.condition = condition;
        return this;
    }

    public List fetch() {
        return entitiesFetcher.fetch(entityType, condition, fieldsToFetch);
    }

    public List fetchByKeys(Collection> keys) {
        return entitiesFetcher.fetch(entityType, keys, condition, fieldsToFetch);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy