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

io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaQuery Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2017-2021 original authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.micronaut.data.model.jpa.criteria;

import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.Internal;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.data.model.PersistentEntity;
import jakarta.persistence.criteria.CriteriaQuery;
import jakarta.persistence.criteria.Expression;
import jakarta.persistence.criteria.Order;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Selection;
import jakarta.persistence.metamodel.EntityType;

import java.util.List;

/**
 * The persistent entity {@link CriteriaQuery}.
 *
 * @param  The entity type
 * @author Denis Stepanov
 * @since 3.2
 */
@Experimental
public interface PersistentEntityCriteriaQuery extends CriteriaQuery, PersistentEntityQuery {

    @NonNull
     PersistentEntityRoot from(@NonNull PersistentEntity persistentEntity);

    @Override
    @NonNull
     PersistentEntityRoot from(@NonNull Class entityClass);

    @Override
    @NonNull
     PersistentEntityRoot from(@NonNull EntityType entity);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery limit(int limit);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery offset(int offset);

    @Internal
    @NonNull
    default PersistentEntityCriteriaQuery forUpdate(boolean forUpdate) {
        return this;
    }

    @Override
    @NonNull
    PersistentEntityCriteriaQuery select(@NonNull Selection selection);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery multiselect(@NonNull Selection... selections);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery multiselect(@NonNull List> selectionList);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery where(@NonNull Expression restriction);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery where(@NonNull Predicate... restrictions);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery groupBy(@NonNull Expression... grouping);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery groupBy(@NonNull List> grouping);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery having(@NonNull Expression restriction);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery having(@NonNull Predicate... restrictions);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery orderBy(@NonNull Order... orders);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery orderBy(@NonNull List orders);

    @Override
    @NonNull
    PersistentEntityCriteriaQuery distinct(boolean distinct);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy