KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > dialect > function > SQLFunction


1 //$Id: SQLFunction.java,v 1.3 2005/04/29 15:32:30 oneovthafew Exp $
2
package org.hibernate.dialect.function;
3
4 import java.util.List JavaDoc;
5
6 import org.hibernate.QueryException;
7 import org.hibernate.engine.Mapping;
8 import org.hibernate.engine.SessionFactoryImplementor;
9 import org.hibernate.type.Type;
10
11 /**
12  * Provides support routines for the HQL functions as used
13  * in the various SQL Dialects
14  *
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.
18  *
19  * @author David Channon
20  */

21 public interface SQLFunction {
22     /**
23      * The function return type
24      * @param columnType the type of the first argument
25      */

26     public Type getReturnType(Type columnType, Mapping mapping) throws QueryException;
27     /**
28      * Does this function have any arguments?
29      */

30     public boolean hasArguments();
31     /**
32      * If there are no arguments, are parens required?
33      */

34     public boolean hasParenthesesIfNoArguments();
35     /**
36      * Render the function call as SQL
37      */

38     public String JavaDoc render(List JavaDoc args, SessionFactoryImplementor factory) throws QueryException;
39 }
40
Popular Tags