KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > criterion > Projection


1 //$Id: Projection.java,v 1.14 2005/02/12 07:19:14 steveebersole Exp $
2
package org.hibernate.criterion;
3
4
5 import java.io.Serializable JavaDoc;
6
7 import org.hibernate.Criteria;
8 import org.hibernate.HibernateException;
9 import org.hibernate.type.Type;
10
11 /**
12  * An object-oriented representation of a query result set projection
13  * in a <tt>Criteria</tt> query. Built-in projection types are provided
14  * by the <tt>Projections</tt> factory class.
15  * This interface might be implemented by application classes that
16  * define custom projections.
17  *
18  * @see Projections
19  * @see org.hibernate.Criteria
20  * @author Gavin King
21  */

22 public interface Projection extends Serializable JavaDoc {
23
24     /**
25      * Render the SQL fragment
26      * @param criteriaQuery
27      * @param columnAlias
28      * @return String
29      * @throws HibernateException
30      */

31     public String JavaDoc toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
32     throws HibernateException;
33     
34     /**
35      * Render the SQL fragment to be used in the group by clause
36      * @param criteriaQuery
37      * @param columnAlias
38      * @return String
39      * @throws HibernateException
40      */

41     public String JavaDoc toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
42     throws HibernateException;
43     
44     /**
45      * Return types returned by the rendered SQL fragment
46      * @param criteria
47      * @param criteriaQuery
48      * @return Type[]
49      * @throws HibernateException
50      */

51     public Type[] getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
52     throws HibernateException;
53     /**
54      * Return types for a particular user-visible alias
55      */

56     public Type[] getTypes(String JavaDoc alias, Criteria criteria, CriteriaQuery criteriaQuery)
57     throws HibernateException;
58         
59     /**
60      * Get the SQL select clause column aliases
61      */

62     public String JavaDoc[] getColumnAliases(int loc);
63     /**
64      * Get the SQL select clause column aliases for a particular
65      * user-visible alias
66      */

67     public String JavaDoc[] getColumnAliases(String JavaDoc alias, int loc);
68     
69     /**
70      * Get the user-visible aliases for this projection
71      * (ie. the ones that will be passed to the
72      * <tt>ResultTransformer</tt>)
73      */

74     public String JavaDoc[] getAliases();
75     
76     /**
77      * Does this projection specify grouping attributes?
78      */

79     public boolean isGrouped();
80     
81 }
82
Popular Tags