java.lang.Object
io.ebeaninternal.server.querydefn.OrmQueryDetail
- All Implemented Interfaces:
Serializable
Represents the internal structure of an Object Relational query.
Holds the select() and join() details of a ORM query.
It is worth noting that for AutoTune 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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNested(String path, OrmQueryDetail other, FetchConfig config) Add a nested OrmQueryDetail to this detail.asString()Return the detail in string form.voidclear()Remove all joins and properties.copy()Return a deep copy of the OrmQueryDetail.entries()Return the underlying fetch path entries.voidfetch(String path, String partialProps, FetchConfig fetchConfig) Set the fetch properties and configuration for a given path.voidfetch(String path, LinkedHashSet<String> properties) Add for raw sql etc when the properties are already parsed into a set.voidfetchProperties(String path, Set<String> properties, FetchConfig fetchConfig) Set fetch properties that are already parsed.Return the fetch paths for this detail.inthashCode()booleanvoidincludeBeanJoin(String parentPath, String propertyName) Add the explicit bean join.booleanincludesPath(String path) Return true if the fetch path is included.booleanisAutoTuneEqual(OrmQueryDetail otherDetail) Return true if equal in terms of autoTune (select and fetch without property ordering).booleanisEmpty()Return true if the query detail has neither select properties specified or any joins defined.booleanReturn true if there are no joins.voidprepareExpressions(BeanQueryRequest<?> request) Prepare filterMany expressions that are being included into the main query.voidqueryPlanHash(StringBuilder builder) Calculate the hash for the query plan.voidset the properties to include on the base / root entity.voidselectProperties(Set<String> properties) Set select properties that are already parsed.voidsetBase(OrmQueryProperties baseProps) Set the base / root query properties.voidsetDefaultSelectClause(BeanDescriptor<?> desc) Set any default select clauses for the main bean and any joins that have not explicitly defined a select clause.voidSet the base query properties to be empty.voidsortFetchPaths(BeanDescriptor<?> d) Sort the fetch paths into depth order adding any missing parent paths if necessary.
-
Constructor Details
-
OrmQueryDetail
public OrmQueryDetail()
-
-
Method Details
-
copy
Return a deep copy of the OrmQueryDetail. -
addNested
Add a nested OrmQueryDetail to this detail. -
queryPlanHash
Calculate the hash for the query plan. -
isAutoTuneEqual
Return true if equal in terms of autoTune (select and fetch without property ordering). -
asString
Return the detail in string form. -
hashCode
public int hashCode() -
select
set the properties to include on the base / root entity. -
selectProperties
Set select properties that are already parsed. -
setEmptyBase
public void setEmptyBase()Set the base query properties to be empty. -
setBase
Set the base / root query properties. -
clear
public void clear()Remove all joins and properties. Typically for the row count query. -
fetch
Set the fetch properties and configuration for a given path.- Parameters:
path- the property to joinpartialProps- the properties on the join property to include
-
fetchProperties
Set fetch properties that are already parsed. -
fetch
Add for raw sql etc when the properties are already parsed into a set. -
sortFetchPaths
Sort the fetch paths into depth order adding any missing parent paths if necessary. -
setDefaultSelectClause
Set any default select clauses for the main bean and any joins that have not explicitly defined a select clause.That is this will use FetchType.LAZY to exclude some properties by default.
-
hasSelectClause
public boolean hasSelectClause() -
isEmpty
public boolean isEmpty()Return true if the query detail has neither select properties specified or any joins defined. -
isJoinsEmpty
public boolean isJoinsEmpty()Return true if there are no joins. -
includeBeanJoin
Add the explicit bean join.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.
-
getChunk
-
includesPath
Return true if the fetch path is included. -
getFetchPaths
Return the fetch paths for this detail. -
entries
Return the underlying fetch path entries. -
prepareExpressions
Prepare filterMany expressions that are being included into the main query.
-