1
//$Id: SQLFunction.java 10775 2006-11-08 16:56:52Z steve.ebersole@jboss.com $
2
package org.hibernate.dialect.function;
6
import org.hibernate.QueryException;
7
import org.hibernate.engine.Mapping;
8
import org.hibernate.engine.SessionFactoryImplementor;
9
import org.hibernate.type.Type;
12
* Provides support routines for the HQL functions as used
13
* in the various SQL Dialects
15
* Provides an interface for supporting various HQL functions that are
16
* translated to SQL. The Dialect and its sub-classes use this interface to
17
* provide details required for processing of the function.
19
* @author David Channon
21
public interface SQLFunction {
23
* The return type of the function. May be either a concrete type which
24
* is preset, or variable depending upon the type of the first function
27
* @param columnType the type of the first argument
28
* @param mapping The mapping source.
29
* @return The type to be expected as a return.
30
* @throws org.hibernate.QueryException Indicates an issue resolving the return type.
32
public Type getReturnType(Type columnType, Mapping mapping) throws QueryException;
35
* Does this function have any arguments?
37
* @return True if the function expects to have parameters; false otherwise.
39
public boolean hasArguments();
42
* If there are no arguments, are parens required?
44
* @return True if a no-arg call of this function requires parentheses.
46
public boolean hasParenthesesIfNoArguments();
49
* Render the function call as SQL fragment.
51
* @param args The function arguments
52
* @param factory The SessionFactory
53
* @return The rendered function call
54
* @throws org.hibernate.QueryException Indicates a problem rendering the
57
public String render(List args, SessionFactoryImplementor factory) throws QueryException;