org.hibernate.query.sqm.function.SqmExtractUnit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-core Show documentation
Show all versions of hibernate-core Show documentation
Hibernate's core ORM functionality
/*
* 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 http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.query.sqm.function;
import org.hibernate.metamodel.model.domain.AllowableFunctionReturnType;
import org.hibernate.query.sqm.NodeBuilder;
import org.hibernate.query.sqm.SqmExpressable;
import org.hibernate.query.sqm.SemanticQueryWalker;
import org.hibernate.query.sqm.tree.AbstractSqmNode;
import org.hibernate.query.sqm.tree.SqmTypedNode;
import org.hibernate.query.sqm.tree.SqmVisitableNode;
/**
* @author Gavin King
*/
public class SqmExtractUnit extends AbstractSqmNode implements SqmTypedNode, SqmVisitableNode {
private String name;
private AllowableFunctionReturnType type;
public SqmExtractUnit(String name, AllowableFunctionReturnType type, NodeBuilder nodeBuilder) {
super( nodeBuilder );
this.type = type;
this.name = name;
}
public AllowableFunctionReturnType getType() {
return type;
}
@Override
public T accept(SemanticQueryWalker walker) {
return walker.visitExtractUnit(this);
}
public String getUnitName() {
return name;
}
@Override
public SqmExpressable getNodeType() {
return type;
}
}