Class QuerySpaceTreePrinter
- java.lang.Object
-
- org.hibernate.loader.plan.build.spi.QuerySpaceTreePrinter
-
public class QuerySpaceTreePrinter extends java.lang.Object
Prints aQuerySpaces
graph as a tree structure. Intended for use in debugging, logging, etc.
-
-
Field Summary
Fields Modifier and Type Field Description static QuerySpaceTreePrinter
INSTANCE
Singleton access
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
asString(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext)
Returns a String containing theQuerySpaces
graph as a tree structure, starting at a particular depth.java.lang.String
asString(QuerySpaces spaces, AliasResolutionContext aliasResolutionContext)
Returns a String containing theQuerySpaces
graph as a tree structure.java.lang.String
extractDetails(QuerySpace space)
Returns a String containing high-level details about theQuerySpace
, such as: query space class name unique ID entity name (forEntityQuerySpace
collection role (forCollectionQuerySpace
*void
write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, java.io.PrintStream printStream)
Returns a String containing theQuerySpaces
graph as a tree structure, starting at a particular depth.void
write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, java.io.PrintWriter printWriter)
Returns a String containing theQuerySpaces
graph as a tree structure, starting at a particular depth.
-
-
-
Field Detail
-
INSTANCE
public static final QuerySpaceTreePrinter INSTANCE
Singleton access
-
-
Method Detail
-
asString
public java.lang.String asString(QuerySpaces spaces, AliasResolutionContext aliasResolutionContext)
Returns a String containing theQuerySpaces
graph as a tree structure.- Parameters:
spaces
- TheQuerySpaces
object.aliasResolutionContext
- The context for resolving table and column aliases for theQuerySpace
references inspaces
; if null, table and column aliases are not included in returned value..- Returns:
- the String containing the
QuerySpaces
graph as a tree structure.
-
asString
public java.lang.String asString(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext)
Returns a String containing theQuerySpaces
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 byTreePrinterHelper.INDENTATION
.- Parameters:
spaces
- TheQuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases for theQuerySpace
references inspaces
; if null, table and column aliases are not included in returned value..- Returns:
- the String containing the
QuerySpaces
graph as a tree structure.
-
write
public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, java.io.PrintStream printStream)
Returns a String containing theQuerySpaces
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 byTreePrinterHelper.INDENTATION
.- Parameters:
spaces
- TheQuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases for theQuerySpace
references inspaces
; if null, table and column aliases are not included in returned value.printStream
- The print stream for writing.
-
write
public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, java.io.PrintWriter printWriter)
Returns a String containing theQuerySpaces
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 byTreePrinterHelper.INDENTATION
.- Parameters:
spaces
- TheQuerySpaces
object.depth
- The intial number of indentationsaliasResolutionContext
- The context for resolving table and column aliases for theQuerySpace
references inspaces
; if null, table and column aliases are not included in returned value.printWriter
- The print writer for writing.
-
extractDetails
public java.lang.String extractDetails(QuerySpace space)
Returns a String containing high-level details about theQuerySpace
, such as:- query space class name
- unique ID
- entity name (for
EntityQuerySpace
- collection role (for
CollectionQuerySpace
*
- Parameters:
space
- The query space- Returns:
- a String containing details about the
QuerySpace
-
-