KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: SQLQueryCollectionReturn.java,v 1.5 2005/06/19 22:16:38 maxcsaucdk Exp $
2
package org.hibernate.loader.custom;
3
4 import java.util.Map JavaDoc;
5
6 import org.hibernate.LockMode;
7
8 /**
9  * Represents a return defined as part of a native sql query which
10  * names a collection role in the form {classname}.{collectionrole}; it
11  * is used in defining a custom sql query for loading an entity's
12  * collection in non-fetching scenarios (i.e., loading the collection
13  * itself as the "root" of the result).
14  *
15  * @author Steve
16  */

17 public class SQLQueryCollectionReturn extends SQLQueryReturn {
18     private String JavaDoc ownerEntityName;
19     private String JavaDoc ownerProperty;
20
21     public SQLQueryCollectionReturn(String JavaDoc alias, String JavaDoc ownerClass, String JavaDoc ownerProperty, Map JavaDoc propertyResults, LockMode lockMode) {
22         super(alias, propertyResults, lockMode);
23         this.ownerEntityName = ownerClass;
24         this.ownerProperty = ownerProperty;
25     }
26
27     /**
28      * Returns the class owning the collection.
29      *
30      * @return The class owning the collection.
31      */

32     public String JavaDoc getOwnerEntityName() {
33         return ownerEntityName;
34     }
35
36     /**
37      * Returns the name of the property representing the collection from the {@link #getOwnerEntityName}.
38      *
39      * @return The name of the property representing the collection on the owner class.
40      */

41     public String JavaDoc getOwnerProperty() {
42         return ownerProperty;
43     }
44 }
45
Popular Tags