KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > SQLQuery


1 //$Id: SQLQuery.java,v 1.10 2005/07/04 02:40:28 oneovthafew Exp $
2
package org.hibernate;
3
4 import org.hibernate.type.Type;
5
6 /**
7  * Allows the user to declare the types and select list injection
8  * points of all entities returned by the query. Also allows
9  * declaration of the type and column alias of any scalar results
10  * of the query.
11  *
12  * @author Gavin King
13  */

14 public interface SQLQuery extends Query {
15     /**
16      * Declare a "root" entity, without specifying an alias
17      */

18     public SQLQuery addEntity(String JavaDoc entityName);
19     /**
20      * Declare a "root" entity
21      */

22     public SQLQuery addEntity(String JavaDoc alias, String JavaDoc entityName);
23     /**
24      * Declare a "root" entity, specifying a lock mode
25      */

26     public SQLQuery addEntity(String JavaDoc alias, String JavaDoc entityName, LockMode lockMode);
27     /**
28      * Declare a "root" entity, without specifying an alias
29      */

30     public SQLQuery addEntity(Class JavaDoc entityClass);
31     /**
32      * Declare a "root" entity
33      */

34     public SQLQuery addEntity(String JavaDoc alias, Class JavaDoc entityClass);
35     /**
36      * Declare a "root" entity, specifying a lock mode
37      */

38     public SQLQuery addEntity(String JavaDoc alias, Class JavaDoc entityClass, LockMode lockMode);
39
40     /**
41      * Declare a "joined" entity
42      */

43     public SQLQuery addJoin(String JavaDoc alias, String JavaDoc path);
44     /**
45      * Declare a "joined" entity, specifying a lock mode
46      */

47     public SQLQuery addJoin(String JavaDoc alias, String JavaDoc path, LockMode lockMode);
48     
49     /**
50      * Declare a scalar query result
51      */

52     public SQLQuery addScalar(String JavaDoc columnAlias, Type type);
53
54     /**
55      * Use a predefined named ResultSetMapping
56      */

57     public SQLQuery setResultSetMapping(String JavaDoc name);
58 }
59
Popular Tags