FileDocCategorySizeDatePackage
VarArgsSQLFunction.javaAPI DocHibernate 3.2.51485Fri Apr 29 10:32:30 BST 2005org.hibernate.dialect.function

VarArgsSQLFunction

public class VarArgsSQLFunction extends Object implements SQLFunction
Support for slightly more general templating than StandardSQLFunction, with an unlimited number of arguments.
author
Gavin King

Fields Summary
private final String
begin
private final String
sep
private final String
end
private final org.hibernate.type.Type
type
Constructors Summary
public VarArgsSQLFunction(org.hibernate.type.Type type, String begin, String sep, String end)

		this.begin = begin;
		this.sep = sep;
		this.end = end;
		this.type = type;
	
public VarArgsSQLFunction(String begin, String sep, String end)

		this.begin = begin;
		this.sep = sep;
		this.end = end;
		this.type = null;
	
Methods Summary
public org.hibernate.type.TypegetReturnType(org.hibernate.type.Type columnType, org.hibernate.engine.Mapping mapping)

		return type==null ? columnType : type;
	
public booleanhasArguments()

		return true;
	
public booleanhasParenthesesIfNoArguments()

		return true;
	
public java.lang.Stringrender(java.util.List args, org.hibernate.engine.SessionFactoryImplementor factory)

		StringBuffer buf = new StringBuffer().append(begin);
		for ( int i=0; i<args.size(); i++ ) {
			buf.append( args.get(i) );
			if (i<args.size()-1) buf.append(sep);
		}
		return buf.append(end).toString();