FileDocCategorySizeDatePackage
ConditionalParenthesisFunction.javaAPI DocHibernate 3.2.51229Wed Nov 08 09:56:52 GMT 2006org.hibernate.dialect.function

ConditionalParenthesisFunction

public class ConditionalParenthesisFunction extends StandardSQLFunction
Essentially the same as {@link org.hibernate.dialect.function.StandardSQLFunction}, except that here the parentheses are not included when no arguments are given.
author
Jonathan Levinson

Fields Summary
Constructors Summary
public ConditionalParenthesisFunction(String name)

		super( name );
	
public ConditionalParenthesisFunction(String name, org.hibernate.type.Type type)

		super( name, type );
	
Methods Summary
public booleanhasParenthesesIfNoArguments()

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

		final boolean hasArgs = !args.isEmpty();
		StringBuffer buf = new StringBuffer();
		buf.append( getName() );
		if ( hasArgs ) {
			buf.append( "(" );
			for ( int i = 0; i < args.size(); i++ ) {
				buf.append( args.get( i ) );
				if ( i < args.size() - 1 ) {
					buf.append( ", " );
				}
			}
			buf.append( ")" );
		}
		return buf.toString();