SubselectFetchpublic class SubselectFetch extends Object
Fields Summary |
---|
private final Set | resultingEntityKeys | private final String | queryString | private final String | alias | private final org.hibernate.persister.entity.Loadable | loadable | private final QueryParameters | queryParameters | private final Map | namedParameterLocMap |
Constructors Summary |
---|
public SubselectFetch(String alias, org.hibernate.persister.entity.Loadable loadable, QueryParameters queryParameters, Set resultingEntityKeys, Map namedParameterLocMap)
this.resultingEntityKeys = resultingEntityKeys;
this.queryParameters = queryParameters;
this.namedParameterLocMap = namedParameterLocMap;
this.loadable = loadable;
this.alias = alias;
//TODO: ugly here:
final String queryString = queryParameters.getFilteredSQL();
int fromIndex = queryString.indexOf(" from ");
int orderByIndex = queryString.lastIndexOf("order by");
this.queryString = orderByIndex>0 ?
queryString.substring(fromIndex, orderByIndex) :
queryString.substring(fromIndex);
|
Methods Summary |
---|
public java.util.Map | getNamedParameterLocMap()
return namedParameterLocMap;
| public QueryParameters | getQueryParameters()
return queryParameters;
| public java.util.Set | getResult()Get the Set of EntityKeys
return resultingEntityKeys;
| public java.lang.String | toString()
return "SubselectFetch(" + queryString + ')";
| public java.lang.String | toSubselectString(java.lang.String ukname)
String[] joinColumns = ukname==null ?
StringHelper.qualify( alias, loadable.getIdentifierColumnNames() ) :
( (PropertyMapping) loadable ).toColumns(alias, ukname);
return new StringBuffer()
.append("select ")
.append( StringHelper.join(", ", joinColumns) )
.append(queryString)
.toString();
|
|