Table Ref
A handle to a node in the query's JOIN tree — either the root entity table or an FK-traversed table reached through a dotted path. Exposes the engine-assigned SQL alias so raw SQL expressions (in Facets built via addSqlFacet, or in setConstraints) can reference the right table regardless of how the engine numbers its joined aliases.
Obtain a TableRef via PagedList.addTableRef or PagedQuery.addTableRef. The library guarantees that the corresponding JOIN is active in every SQL build for which isActive is true, without the caller having to reference the table elsewhere.
Example
val query = PagedQuery<Customer>().apply {
val address = addTableRef("address")
addFacet("name", "name")
addSqlFacet("cityDisplay", "${address}.city", Facet.TEXT)
// ^ toString() returns alias
}String interpolation ("${address}.city") reads the alias via toString. The explicit alias property is also available for Java callers: "${address.getAlias()}.city".
Activation
By default, every registered TableRef keeps its JOIN active on every SQL build. Toggle isActive to false to disable the ref without removing it — useful when a ref is referenced by a raw facet that is conditionally present. Note that in a stateless PagedQuery, toggling isActive after publishing the query to concurrent callers is undefined behavior; set the flag during setup only.