KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > engine > ResultSetMappingDefinition


1 //$Id: ResultSetMappingDefinition.java,v 1.1 2005/06/23 14:59:53 oneovthafew Exp $
2
package org.hibernate.engine;
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.List JavaDoc;
6 import java.io.Serializable JavaDoc;
7
8 import org.hibernate.loader.custom.SQLQueryReturn;
9 import org.hibernate.loader.custom.SQLQueryScalarReturn;
10
11 /**
12  * Keep a description of the resultset mapping
13  *
14  * @author Emmanuel Bernard
15  */

16 public class ResultSetMappingDefinition implements Serializable JavaDoc {
17     /** List<SQLQueryReturn> */
18     private List JavaDoc entityQueryReturns = new ArrayList JavaDoc();
19     /** List<SQLQueryScalarReturn> */
20     private List JavaDoc scalarQueryReturns = new ArrayList JavaDoc();
21     private String JavaDoc name;
22
23     public String JavaDoc getName() {
24         return name;
25     }
26
27     public ResultSetMappingDefinition(String JavaDoc name) {
28         this.name = name;
29     }
30
31     public void addEntityQueryReturn(SQLQueryReturn entityQueryReturn) {
32         entityQueryReturns.add(entityQueryReturn);
33     }
34
35     public void addScalarQueryReturn(SQLQueryScalarReturn scalarQueryReturn) {
36         scalarQueryReturns.add(scalarQueryReturn);
37     }
38
39     public SQLQueryReturn[] getEntityQueryReturns() {
40         return (SQLQueryReturn[]) entityQueryReturns.toArray( new SQLQueryReturn[0] );
41     }
42
43     public SQLQueryScalarReturn[] getScalarQueryReturns() {
44         return (SQLQueryScalarReturn[]) scalarQueryReturns.toArray( new SQLQueryScalarReturn[0] );
45     }
46 }
47
Popular Tags