KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: SimpleProjection.java,v 1.2 2005/02/12 07:19:14 steveebersole Exp $
2
package org.hibernate.criterion;
3
4 import org.hibernate.Criteria;
5 import org.hibernate.HibernateException;
6 import org.hibernate.type.Type;
7
8
9 /**
10  * A single-column projection that may be aliased
11  * @author Gavin King
12  */

13 public abstract class SimpleProjection implements Projection {
14
15     public Projection as(String JavaDoc alias) {
16         return Projections.alias(this, alias);
17     }
18
19     public String JavaDoc[] getColumnAliases(String JavaDoc alias, int loc) {
20         return null;
21     }
22     
23     public Type[] getTypes(String JavaDoc alias, Criteria criteria, CriteriaQuery criteriaQuery)
24     throws HibernateException {
25         return null;
26     }
27
28     public String JavaDoc[] getColumnAliases(int loc) {
29         return new String JavaDoc[] { "y" + loc + "_" };
30     }
31     
32     public String JavaDoc[] getAliases() {
33         return new String JavaDoc[1];
34     }
35
36     public String JavaDoc toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
37     throws HibernateException {
38         throw new UnsupportedOperationException JavaDoc("not a grouping projection");
39     }
40
41     public boolean isGrouped() {
42         return false;
43     }
44
45 }
46
Popular Tags