Top Fields Constructors Methods
org.hibernate.engine.spi

public Class SubselectFetch

extends Object
Class Inheritance
Imports
java.util.Map, .Set, org.jboss.logging.Logger, org.hibernate.internal.CoreMessageLogger, org.hibernate.internal.util.StringHelper, org.hibernate.persister.entity.Loadable, .PropertyMapping

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final String
private static final String
private final Loadable
private static final CoreMessageLogger
private final Map<K, V>
private final QueryParameters
private final String
private final Set<E>

Constructor Summary

AccessConstructor and Description
public
SubselectFetch(final String
- the table alias used in the subselect fetch query fragment (to be generated by createSubselectFetchQueryFragment(QueryParameters) that corresponds to loadable;
alias
,
final Loadable
- the Loadable for the associated entities to be subselect fetched;
loadable
,
final QueryParameters
- the query parameters;
queryParameters
,
final Set<E>
- the EntityKey objects for the entities to be subselect fetched;
resultingEntityKeys
,
final Map<K, V>
- mapping from named parameter to the parameter index located in the subselect fetch query fragment.
namedParameterLocMap
)

Construct a SubselectFetch instance.

public
SubselectFetch(final String
- the subselect fetch query fragment;
subselectFetchQueryFragment
,
final String
- the table alias used in subselectFetchQueryFragment that corresponds to loadable;
alias
,
final Loadable
- the Loadable for the associated entities to be subselect fetched;
loadable
,
final QueryParameters
- the query parameters;
queryParameters
,
final Set<E>
- the EntityKey objects for the entities to be subselect fetched;
resultingEntityKeys
,
final Map<K, V>
- mapping from named parameter to the parameter index located in the subselect fetch query fragment.
namedParameterLocMap
)

Construct a SubselectFetch instance using the provided subselect fetch query fragment, subselectFetchQueryFragment.

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

the subselect fetch query fragment.
createSubselectFetchQueryFragment
(QueryParameters
-the query parameters.
queryParameters
)

Create the subselect fetch query fragment for the provided QueryParameters with SELECT and ORDER BY clauses removed.

private static int
getFromIndex(String queryString)

public Map<K, V>
public QueryParameters
public Set<E>
getResult()

Get the Set of EntityKeys

private static boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

aliasback to summary
private final String alias
FROM_STRINGback to summary
private static final String FROM_STRING
loadableback to summary
private final Loadable loadable
LOGback to summary
private static final CoreMessageLogger LOG
namedParameterLocMapback to summary
private final Map<K, V> namedParameterLocMap
queryParametersback to summary
private final QueryParameters queryParameters
queryStringback to summary
private final String queryString
resultingEntityKeysback to summary
private final Set<E> resultingEntityKeys

Constructor Detail

SubselectFetchback to summary
public SubselectFetch(final String alias, final Loadable loadable, final QueryParameters queryParameters, final Set<E> resultingEntityKeys, final Map<K, V> namedParameterLocMap)

Construct a SubselectFetch instance. The subselect fetch query fragment is generated by createSubselectFetchQueryFragment. If the same value for queryParameters is to be used when constructing multiple SubselectFetch objects, then it is preferable to generate the subselect fetch query fragment using createSubselectFetchQueryFragment, and pass the result as an argument to constructor SubselectFetch(String, String, Loadable, QueryParameters, Set, Map).

Parameters
alias:String

- the table alias used in the subselect fetch query fragment (to be generated by createSubselectFetchQueryFragment(QueryParameters) that corresponds to loadable;

loadable:Loadable

- the Loadable for the associated entities to be subselect fetched;

queryParameters:QueryParameters

- the query parameters;

resultingEntityKeys:Set<E>

- the EntityKey objects for the entities to be subselect fetched;

namedParameterLocMap:Map<K, V>

- mapping from named parameter to the parameter index located in the subselect fetch query fragment.

See Also
SubselectFetch(String, String, Loadable, QueryParameters, Set, Map)
SubselectFetchback to summary
public SubselectFetch(final String subselectFetchQueryFragment, final String alias, final Loadable loadable, final QueryParameters queryParameters, final Set<E> resultingEntityKeys, final Map<K, V> namedParameterLocMap)

Construct a SubselectFetch instance using the provided subselect fetch query fragment, subselectFetchQueryFragment. It is assumed that subselectFetchQueryFragment is the result of calling createSubselectFetchQueryFragment with the same value provided for queryParameters.

Parameters
subselectFetchQueryFragment:String

- the subselect fetch query fragment;

alias:String

- the table alias used in subselectFetchQueryFragment that corresponds to loadable;

loadable:Loadable

- the Loadable for the associated entities to be subselect fetched;

queryParameters:QueryParameters

- the query parameters;

resultingEntityKeys:Set<E>

- the EntityKey objects for the entities to be subselect fetched;

namedParameterLocMap:Map<K, V>

- mapping from named parameter to the parameter index located in the subselect fetch query fragment.

Method Detail

createSubselectFetchQueryFragmentback to summary
public static String createSubselectFetchQueryFragment(QueryParameters queryParameters)

Create the subselect fetch query fragment for the provided QueryParameters with SELECT and ORDER BY clauses removed.

Parameters
queryParameters:QueryParameters

-the query parameters.

Returns:String

the subselect fetch query fragment.

getFromIndexback to summary
private static int getFromIndex(String queryString)
getNamedParameterLocMapback to summary
public Map<K, V> getNamedParameterLocMap()
getQueryParametersback to summary
public QueryParameters getQueryParameters()
getResultback to summary
public Set<E> getResult()

Get the Set of EntityKeys

parenthesesMatchback to summary
private static boolean parenthesesMatch(String string)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
toSubselectStringback to summary
public String toSubselectString(String ukname)