
org.hibernate.jpa.criteria.expression.NullLiteralExpression 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.expression;
import java.io.Serializable;
import org.hibernate.jpa.criteria.CriteriaBuilderImpl;
import org.hibernate.jpa.criteria.ParameterRegistry;
import org.hibernate.jpa.criteria.compile.RenderingContext;
import org.hibernate.jpa.criteria.expression.function.CastFunction;
/**
* Represents a NULLliteral expression.
*
* @author Steve Ebersole
*/
public class NullLiteralExpression extends ExpressionImpl implements Serializable {
public NullLiteralExpression(CriteriaBuilderImpl criteriaBuilder, Class type) {
super( criteriaBuilder, type );
}
public void registerParameters(ParameterRegistry registry) {
// nothing to do
}
public String render(RenderingContext renderingContext) {
return "null";
}
public String renderProjection(RenderingContext renderingContext) {
return CastFunction.CAST_NAME + "( null as " + renderingContext.getCastType( getJavaType() ) + ')';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy