public class OrmQueryDetail extends Object implements Serializable
Holds the select() and join() details of a ORM query.
It is worth noting that for autoFetch a "tuned fetch info" builds an instance of OrmQueryDetail. Tuning a query is a matter of replacing an instance of this class with one that has been tuned with select() and join() set.
| Constructor and Description |
|---|
OrmQueryDetail() |
| Modifier and Type | Method and Description |
|---|---|
OrmQueryProperties |
addFetch(String path,
String partialProps,
FetchConfig fetchConfig)
Set the fetch properties and configuration for a given path.
|
void |
clear()
Remove all joins and properties.
|
boolean |
containsProperty(String property) |
void |
convertManyFetchJoinsToQueryJoins(BeanDescriptor<?> beanDescriptor,
String lazyLoadManyPath,
boolean allowOne,
int queryBatch)
Convert 'fetch joins' to 'many' properties over to 'query joins'.
|
OrmQueryDetail |
copy()
Return a deep copy of the OrmQueryDetail.
|
OrmQueryProperties |
getChunk(String path,
boolean create) |
HashSet<String> |
getIncludes()
Return the property includes for this detail.
|
int |
hashCode() |
boolean |
hasSelectClause() |
void |
includeBeanJoin(String parentPath,
String propertyName)
Add the explicit bean join.
|
boolean |
includes(String path)
Return true if the property is included.
|
boolean |
isAutoFetchEqual(OrmQueryDetail otherDetail)
Return true if equal in terms of autofetch (select and joins).
|
boolean |
isEmpty()
Return true if the query detail has neither select properties specified
or any joins defined.
|
boolean |
isJoinsEmpty()
Return true if there are no joins.
|
void |
putFetchPath(OrmQueryProperties chunk)
Matches a join() method of the query.
|
void |
queryPlanHash(BeanQueryRequest<?> request,
HashQueryPlanBuilder builder)
Calculate the hash for the query plan.
|
List<OrmQueryProperties> |
removeSecondaryLazyQueries() |
List<OrmQueryProperties> |
removeSecondaryQueries() |
void |
select(String columns)
set the properties to include on the base / root entity.
|
void |
setBase(OrmQueryProperties baseProps)
Set the base / root query properties.
|
void |
setDefaultSelectClause(BeanDescriptor<?> desc)
Set any default select clauses for the main bean and any joins that have
not explicitly defined a select clause.
|
void |
sortFetchPaths(BeanDescriptor<?> d) |
String |
toString() |
boolean |
tuneFetchProperties(OrmQueryDetail tunedDetail) |
public OrmQueryDetail copy()
public void queryPlanHash(BeanQueryRequest<?> request, HashQueryPlanBuilder builder)
public boolean isAutoFetchEqual(OrmQueryDetail otherDetail)
public void select(String columns)
public boolean containsProperty(String property)
public void setBase(OrmQueryProperties baseProps)
public List<OrmQueryProperties> removeSecondaryQueries()
public List<OrmQueryProperties> removeSecondaryLazyQueries()
public boolean tuneFetchProperties(OrmQueryDetail tunedDetail)
public void putFetchPath(OrmQueryProperties chunk)
public void clear()
Typically for the row count query.
public OrmQueryProperties addFetch(String path, String partialProps, FetchConfig fetchConfig)
path - the property to joinpartialProps - the properties on the join property to includepublic void sortFetchPaths(BeanDescriptor<?> d)
public void convertManyFetchJoinsToQueryJoins(BeanDescriptor<?> beanDescriptor, String lazyLoadManyPath, boolean allowOne, int queryBatch)
public void setDefaultSelectClause(BeanDescriptor<?> desc)
That is this will use FetchType.LAZY to exclude some properties by default.
public boolean hasSelectClause()
public boolean isEmpty()
public boolean isJoinsEmpty()
public void includeBeanJoin(String parentPath, String propertyName)
This is also used to Exclude the matching property from the parent select (aka remove the foreign key) because it is now included in it's on node in the SqlTree.
public OrmQueryProperties getChunk(String path, boolean create)
public boolean includes(String path)
Copyright © 2014. All Rights Reserved.