KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > loader > custom > SQLQueryReturn


1 // $Id: SQLQueryReturn.java,v 1.5 2005/06/19 22:16:38 maxcsaucdk Exp $
2
package org.hibernate.loader.custom;
3
4 import java.io.Serializable JavaDoc;
5 import java.util.Collections JavaDoc;
6 import java.util.HashMap JavaDoc;
7 import java.util.Map JavaDoc;
8
9 import org.hibernate.HibernateException;
10 import org.hibernate.LockMode;
11
12 /**
13  * Represents the base information for a return defined as part of
14  * a native sql query.
15  *
16  * @author Steve
17  */

18 public abstract class SQLQueryReturn implements Serializable JavaDoc {
19     private String JavaDoc alias;
20     private LockMode lockMode;
21     protected Map JavaDoc propertyResults = new HashMap JavaDoc();
22     
23     protected SQLQueryReturn(String JavaDoc alias, Map JavaDoc propertyResults, LockMode lockMode) {
24         this.alias = alias;
25         if(alias==null) throw new HibernateException("alias must be specified");
26         this.lockMode = lockMode;
27         if(propertyResults!=null) {
28             this.propertyResults = propertyResults;
29         }
30     }
31
32     public String JavaDoc getAlias() {
33         return alias;
34     }
35
36     public LockMode getLockMode() {
37         return lockMode;
38     }
39     
40     public Map JavaDoc getPropertyResultsMap() {
41         return Collections.unmodifiableMap(propertyResults);
42     }
43 }
44
Popular Tags