
org.hibernate.jpa.criteria.CriteriaDeleteImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-entitymanager
Show all versions of hibernate-entitymanager
A module of the Hibernate O/RM project
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.jpa.criteria;
import javax.persistence.criteria.CriteriaDelete;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Predicate;
import org.hibernate.jpa.criteria.compile.RenderingContext;
/**
* Hibernate implementation of the JPA 2.1 {@link CriteriaDelete} contract.
*
* @author Steve Ebersole
*/
public class CriteriaDeleteImpl extends AbstractManipulationCriteriaQuery implements CriteriaDelete {
protected CriteriaDeleteImpl(CriteriaBuilderImpl criteriaBuilder) {
super( criteriaBuilder );
}
@Override
public CriteriaDelete where(Expression restriction) {
setRestriction( restriction );
return this;
}
@Override
public CriteriaDelete where(Predicate... restrictions) {
setRestriction( restrictions );
return this;
}
@Override
protected String renderQuery(RenderingContext renderingContext) {
final StringBuilder jpaql = new StringBuilder( "delete " );
renderRoot( jpaql, renderingContext );
renderRestrictions( jpaql, renderingContext );
return jpaql.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy