Top Description Fields Constructors Methods
org.hibernate.loader.plan.build.spi

public Class QuerySpaceTreePrinter

extends Object
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .PrintStream, .PrintWriter, org.hibernate.loader.EntityAliases, org.hibernate.loader.plan.exec.spi.AliasResolutionContext, .CollectionReferenceAliases, .EntityReferenceAliases, org.hibernate.loader.plan.spi.CollectionQuerySpace, .CompositeQuerySpace, .EntityQuerySpace, .Join, .JoinDefinedByMetadata, .QuerySpace, .QuerySpaces

Prints a QuerySpaces graph as a tree structure.

Intended for use in debugging, logging, etc.

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final int
public static final QuerySpaceTreePrinter
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the String containing the QuerySpaces graph as a tree structure.
asString
(QuerySpaces
The QuerySpaces object.
spaces
,
AliasResolutionContext
The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value..
aliasResolutionContext
)

Returns a String containing the QuerySpaces graph as a tree structure.

public String

Returns:

the String containing the QuerySpaces graph as a tree structure.
asString
(QuerySpaces
The QuerySpaces object.
spaces
,
int
The initial number of indentations
depth
,
AliasResolutionContext
The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value..
aliasResolutionContext
)

Returns a String containing the QuerySpaces graph as a tree structure, starting at a particular depth.

private String
public String

Returns:

a String containing details about the QuerySpace
extractDetails
(QuerySpace
The query space
space
)

Returns a String containing high-level details about the QuerySpace, such as:

private String
private void
generateDetailLines(QuerySpace querySpace, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)

public void
write(QuerySpaces
The QuerySpaces object.
spaces
,
int
The initial number of indentations
depth
,
AliasResolutionContext
The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value.
aliasResolutionContext
,
PrintStream
The print stream for writing.
printStream
)

Returns a String containing the QuerySpaces graph as a tree structure, starting at a particular depth.

public void
write(QuerySpaces
The QuerySpaces object.
spaces
,
int
The initial number of indentations
depth
,
AliasResolutionContext
The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value.
aliasResolutionContext
,
PrintWriter
The print writer for writing.
printWriter
)

Returns a String containing the QuerySpaces graph as a tree structure, starting at a particular depth.

private void
writeJoins(Iterable<Join> joins, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)

private void
writeQuerySpace(QuerySpace querySpace, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

detailDepthOffsetback to summary
private static final int detailDepthOffset
INSTANCEback to summary
public static final QuerySpaceTreePrinter INSTANCE

Singleton access

Constructor Detail

QuerySpaceTreePrinterback to summary
private QuerySpaceTreePrinter()

Method Detail

asStringback to summary
public String asString(QuerySpaces spaces, AliasResolutionContext aliasResolutionContext)

Returns a String containing the QuerySpaces graph as a tree structure.

Parameters
spaces:QuerySpaces

The QuerySpaces object.

aliasResolutionContext:AliasResolutionContext

The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value..

Returns:String

the String containing the QuerySpaces graph as a tree structure.

asStringback to summary
public String asString(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext)

Returns a String containing the 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 TreePrinterHelper#INDENTATION.

Parameters
spaces:QuerySpaces

The QuerySpaces object.

depth:int

The initial number of indentations

aliasResolutionContext:AliasResolutionContext

The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value..

Returns:String

the String containing the QuerySpaces graph as a tree structure.

determineJoinTypeback to summary
private String determineJoinType(Join join)
extractDetailsback to summary
public String extractDetails(QuerySpace space)

Returns a String containing high-level details about the QuerySpace, such as:

Parameters
space:QuerySpace

The query space

Returns:String

a String containing details about the QuerySpace

extractDetailsback to summary
private String extractDetails(Join join)
generateDetailLinesback to summary
private void generateDetailLines(QuerySpace querySpace, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)
writeback to summary
public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, PrintStream printStream)

Returns a String containing the 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 TreePrinterHelper#INDENTATION.

Parameters
spaces:QuerySpaces

The QuerySpaces object.

depth:int

The initial number of indentations

aliasResolutionContext:AliasResolutionContext

The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value.

printStream:PrintStream

The print stream for writing.

writeback to summary
public void write(QuerySpaces spaces, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)

Returns a String containing the 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 TreePrinterHelper#INDENTATION.

Parameters
spaces:QuerySpaces

The QuerySpaces object.

depth:int

The initial number of indentations

aliasResolutionContext:AliasResolutionContext

The context for resolving table and column aliases for the QuerySpace references in spaces; if null, table and column aliases are not included in returned value.

printWriter:PrintWriter

The print writer for writing.

writeJoinsback to summary
private void writeJoins(Iterable<Join> joins, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)
writeQuerySpaceback to summary
private void writeQuerySpace(QuerySpace querySpace, int depth, AliasResolutionContext aliasResolutionContext, PrintWriter printWriter)