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

org.hibernate.query.sqm.tree.expression.SqmConstantFieldReference Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha2
Show newest version
/*
 * 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.tree.expression;

import java.lang.reflect.Field;

import org.hibernate.query.sqm.consume.spi.SemanticQueryWalker;
import org.hibernate.sql.ast.produce.metamodel.spi.BasicValuedExpressableType;

/**
 * Represents a constant that came from a static field reference.
 *
 * @author Steve Ebersole
 */
public class SqmConstantFieldReference extends AbstractSqmLiteral implements SqmConstantReference {
	private final Field sourceField;

	public SqmConstantFieldReference(Field sourceField, T value, BasicValuedExpressableType inherentType) {
		super( value, inherentType );
		this.sourceField = sourceField;
	}

	public Field getSourceField() {
		return sourceField;
	}

	@Override
	public  X accept(SemanticQueryWalker walker) {
		return walker.visitConstantFieldReference( this );
	}

	@Override
	public String asLoggableText() {
		return "ConstantField(" + getLiteralValue() + ")";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy