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

io.micronaut.data.model.jpa.criteria.PersistentEntityCriteriaUpdate 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.NonNull;
import io.micronaut.core.annotation.Nullable;
import io.micronaut.data.model.PersistentEntity;
import jakarta.persistence.criteria.CriteriaUpdate;
import jakarta.persistence.criteria.Expression;
import jakarta.persistence.criteria.ParameterExpression;
import jakarta.persistence.criteria.Path;
import jakarta.persistence.criteria.Predicate;
import jakarta.persistence.criteria.Selection;
import jakarta.persistence.metamodel.EntityType;
import jakarta.persistence.metamodel.SingularAttribute;

import java.util.List;
import java.util.Set;

/**
 * The persistent entity {@link CriteriaUpdate}.
 *
 * @param  The entity type
 * @author Denis Stepanov
 * @since 3.2
 */
@Experimental
public interface PersistentEntityCriteriaUpdate extends CriteriaUpdate, PersistentEntityCommonAbstractCriteria {

    @NonNull
    PersistentEntityRoot from(@NonNull PersistentEntity persistentEntity);

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

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

    @Override
    @NonNull
    PersistentEntityRoot getRoot();

    @Override
    @NonNull  PersistentEntityCriteriaUpdate set(@NonNull SingularAttribute attribute, @Nullable X value);

    @Override
    @NonNull  PersistentEntityCriteriaUpdate set(@NonNull SingularAttribute attribute, @NonNull Expression value);

    @Override
    @NonNull  PersistentEntityCriteriaUpdate set(@NonNull Path attribute, @Nullable X value);

    @Override
    @NonNull  PersistentEntityCriteriaUpdate set(@NonNull Path attribute, @NonNull Expression value);

    @Override
    @NonNull
    PersistentEntityCriteriaUpdate set(@NonNull String attributeName, @Nullable Object value);

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

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

    @NonNull
    Set> getParameters();

    /**
     * The returning result of the query.
     *
     * @param selection The selection to return
     * @return The update criteria.
     * @since 4.2.0
     */
    @Experimental
    @NonNull
    PersistentEntityCriteriaUpdate returning(@NonNull Selection selection);


    /**
     * The returning result of the query.
     *
     * @param selections The multi selection to return
     * @return The update criteria.
     * @since 4.2.0
     */
    @Experimental
    @NonNull
    PersistentEntityCriteriaUpdate returningMulti(@NonNull Selection... selections);

    /**
     * The returning result of the query.
     *
     * @param selectionList The multi selection to return
     * @return The update criteria.
     * @since 4.2.0
     */
    @Experimental
    @NonNull
    PersistentEntityCriteriaUpdate returningMulti(@NonNull List> selectionList);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy