01: // $Id: NativeSQLQueryRootReturn.java 7232 2005-06-19 17:16:40 -0500 (Sun, 19 Jun 2005) maxcsaucdk $
02: package org.hibernate.engine.query.sql;
03:
04: import java.util.Map;
05:
06: import org.hibernate.LockMode;
07:
08: /**
09: * Represents a return defined as part of a native sql query which
10: * names a "root" entity. A root entity means it is explicitly a
11: * "column" in the result, as opposed to a fetched relationship or role.
12: *
13: * @author Steve Ebersole
14: */
15: public class NativeSQLQueryRootReturn extends
16: NativeSQLQueryNonScalarReturn {
17: private String returnEntityName;
18:
19: /**
20: * Construct a return representing an entity returned at the root
21: * of the result.
22: *
23: * @param alias The result alias
24: * @param entityName The entity name.
25: * @param lockMode The lock mode to apply
26: */
27: public NativeSQLQueryRootReturn(String alias, String entityName,
28: LockMode lockMode) {
29: this (alias, entityName, null, lockMode);
30: }
31:
32: /**
33: *
34: * @param alias The result alias
35: * @param entityName The entity name.
36: * @param propertyResults Any user-supplied column->property mappings
37: * @param lockMode The lock mode to apply
38: */
39: public NativeSQLQueryRootReturn(String alias, String entityName,
40: Map propertyResults, LockMode lockMode) {
41: super (alias, propertyResults, lockMode);
42: this .returnEntityName = entityName;
43:
44: }
45:
46: /**
47: * The name of the entity to be returned.
48: *
49: * @return The entity name
50: */
51: public String getReturnEntityName() {
52: return returnEntityName;
53: }
54:
55: }
|