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

com.blazebit.persistence.criteria.BlazeCriteriaDelete Maven / Gradle / Ivy

There is a newer version: 1.6.11
Show newest version
/*
 * Copyright 2014 - 2021 Blazebit.
 *
 * 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
 *
 *      http://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 com.blazebit.persistence.criteria;

import com.blazebit.persistence.DeleteCriteriaBuilder;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaDelete;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import javax.persistence.metamodel.EntityType;

/**
 * An extended version of {@link CriteriaDelete}.
 *
 * @param  The entity type that is the target of the delete
 * @author Christian Beikov
 * @since 1.2.0
 */
public interface BlazeCriteriaDelete extends CriteriaDelete, BlazeCommonAbstractCriteria {

    /**
     * Create a Blaze-Persistence Core {@link DeleteCriteriaBuilder} from this query.
     *
     * @param entityManager The entity manager to which to bind the criteria builder
     * @return A new criteria builder
     * @since 1.3.0
     */
    public DeleteCriteriaBuilder createCriteriaBuilder(EntityManager entityManager);

    /**
     * Like {@link CriteriaDelete#from(Class)} but allows to set the alias of the {@link BlazeRoot}.
     *
     * @param entityClass the entity class
     * @param alias       The alias for the {@link BlazeRoot}
     * @return query root corresponding to the given entity
     */
    public BlazeRoot from(Class entityClass, String alias);

    /**
     * Like {@link CriteriaDelete#from(EntityType)} but allows to set the alias of the {@link BlazeRoot}.
     *
     * @param entityType the entity type
     * @param alias      The alias for the {@link BlazeRoot}
     * @return query root corresponding to the given entity
     */
    public BlazeRoot from(EntityType entityType, String alias);

    /* Covariant overrides */

    @Override
    public BlazeRoot from(Class entityClass);

    @Override
    public BlazeRoot from(EntityType entity);

    @Override
    public BlazeRoot getRoot();

    @Override
    public BlazeCriteriaDelete where(Expression restriction);

    @Override
    public BlazeCriteriaDelete where(Predicate... restrictions);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy