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

org.hibernate.dialect.function.StandardJDBCEscapeFunction Maven / Gradle / Ivy

There is a newer version: 6.5.0.CR2
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 .
 */
package org.hibernate.dialect.function;
import java.util.List;

import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.type.Type;

/**
 * Analogous to {@link org.hibernate.dialect.function.StandardSQLFunction}
 * except that standard JDBC escape sequences (i.e. {fn blah}) are used when
 * rendering the SQL.
 *
 * @author Steve Ebersole
 */
public class StandardJDBCEscapeFunction extends StandardSQLFunction {
	/**
	 * Constructs a StandardJDBCEscapeFunction
	 *
	 * @param name The function name
	 * @param typeValue The function return type
	 */
	public StandardJDBCEscapeFunction(String name, Type typeValue) {
		super( name, typeValue );
	}

	@Override
	public String render(Type argumentType, List args, SessionFactoryImplementor factory) {
		return "{fn " + super.render( argumentType, args, factory ) + "}";
	}

	@Override
	public String toString() {
		return "{fn " + getName() + "...}";
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy