use of org.hibernate.loader.plan.spi.QuerySpace in project hibernate-orm by hibernate.
the class QuerySpacesImpl method registerQuerySpace.
/**
* Feeds a QuerySpace into this spaces group.
*
* @param querySpace The space
*/
private void registerQuerySpace(QuerySpace querySpace) {
log.debugf("Adding QuerySpace : uid = %s -> %s]", querySpace.getUid(), querySpace);
final QuerySpace previous = querySpaceByUid.put(querySpace.getUid(), querySpace);
if (previous != null) {
throw new IllegalStateException("Encountered duplicate QuerySpace uid : " + querySpace.getUid());
}
}
use of org.hibernate.loader.plan.spi.QuerySpace in project hibernate-orm by hibernate.
the class QuerySpaceTreePrinter method write.
/**
* Returns a String containing the {@link QuerySpaces} graph as a tree structure, starting
* at a particular depth.
*
* The value for depth indicates the number of indentations that will
* prefix all lines in the returned String. Root query spaces will be written with depth + 1
* and the depth will be further incremented as joined query spaces are traversed.
*
* An indentation is defined as the number of characters defined by {@link TreePrinterHelper#INDENTATION}.
*
* @param spaces The {@link QuerySpaces} object.
* @param depth The intial number of indentations
* @param aliasResolutionContext The context for resolving table and column aliases
* for the {@link QuerySpace} references in <code>spaces</code>; if null,
* table and column aliases are not included in returned value.
* @param printWriter The print writer for writing.
*/
public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter) {
if (spaces == null) {
printWriter.println("QuerySpaces is null!");
return;
}
printWriter.println(TreePrinterHelper.INSTANCE.generateNodePrefix(depth) + "QuerySpaces");
for (QuerySpace querySpace : spaces.getRootQuerySpaces()) {
writeQuerySpace(querySpace, depth + 1, aliasResolutionContext, printWriter);
}
printWriter.flush();
}
Aggregations