sqlquerycollectionreturn.java
来自「hibernate-3.1.3-all-src.zip 面向对象的访问数据库工」· Java 代码 · 共 45 行
JAVA
45 行
// $Id: SQLQueryCollectionReturn.java 7232 2005-06-19 22:16:40Z maxcsaucdk $
package org.hibernate.loader.custom;
import java.util.Map;
import org.hibernate.LockMode;
/**
* Represents a return defined as part of a native sql query which
* names a collection role in the form {classname}.{collectionrole}; it
* is used in defining a custom sql query for loading an entity's
* collection in non-fetching scenarios (i.e., loading the collection
* itself as the "root" of the result).
*
* @author Steve
*/
public class SQLQueryCollectionReturn extends SQLQueryReturn {
private String ownerEntityName;
private String ownerProperty;
public SQLQueryCollectionReturn(String alias, String ownerClass, String ownerProperty, Map propertyResults, LockMode lockMode) {
super(alias, propertyResults, lockMode);
this.ownerEntityName = ownerClass;
this.ownerProperty = ownerProperty;
}
/**
* Returns the class owning the collection.
*
* @return The class owning the collection.
*/
public String getOwnerEntityName() {
return ownerEntityName;
}
/**
* Returns the name of the property representing the collection from the {@link #getOwnerEntityName}.
*
* @return The name of the property representing the collection on the owner class.
*/
public String getOwnerProperty() {
return ownerProperty;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?