01: package org.hibernate.loader.custom;
02:
03: import org.hibernate.LockMode;
04: import org.hibernate.loader.CollectionAliases;
05: import org.hibernate.loader.EntityAliases;
06:
07: /**
08: * Represents a return which names a collection role; it
09: * is used in defining a custom query for loading an entity's
10: * collection in non-fetching scenarios (i.e., loading the collection
11: * itself as the "root" of the result).
12: *
13: * @author Steve Ebersole
14: */
15: public class CollectionReturn extends NonScalarReturn {
16: private final String ownerEntityName;
17: private final String ownerProperty;
18: private final CollectionAliases collectionAliases;
19: private final EntityAliases elementEntityAliases;
20:
21: public CollectionReturn(String alias, String ownerEntityName,
22: String ownerProperty, CollectionAliases collectionAliases,
23: EntityAliases elementEntityAliases, LockMode lockMode) {
24: super (alias, lockMode);
25: this .ownerEntityName = ownerEntityName;
26: this .ownerProperty = ownerProperty;
27: this .collectionAliases = collectionAliases;
28: this .elementEntityAliases = elementEntityAliases;
29: }
30:
31: /**
32: * Returns the class owning the collection.
33: *
34: * @return The class owning the collection.
35: */
36: public String getOwnerEntityName() {
37: return ownerEntityName;
38: }
39:
40: /**
41: * Returns the name of the property representing the collection from the {@link #getOwnerEntityName}.
42: *
43: * @return The name of the property representing the collection on the owner class.
44: */
45: public String getOwnerProperty() {
46: return ownerProperty;
47: }
48:
49: public CollectionAliases getCollectionAliases() {
50: return collectionAliases;
51: }
52:
53: public EntityAliases getElementEntityAliases() {
54: return elementEntityAliases;
55: }
56: }
|