[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5064?page=c...
]
Shawn Clowater updated HHH-5064:
--------------------------------
Attachment: HHH-5064.patch
Change to the OrderByFragmentTranslator to use the non generated OrderbyFragmentRenderer
that logs output to the logger at a trace level vs dumping to console.
OrderBy string getting dumped to console on session factory creation
--------------------------------------------------------------------
Key: HHH-5064
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5064
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Reporter: Shawn Clowater
Priority: Trivial
Attachments: HHH-5064.patch
I noticed the following when firing our app up the first time after updating to 3.5
final
{code}
> orderByFragment(order-by)
> sortSpecification({sort specification})
> sortKeySpecification(sort key)
> sortKey($PlaceHolder$.DISPLAY_ORDER)
< sortKey(null)
< sortKeySpecification(asc)
> orderingSpecification(asc)
< orderingSpecification(null)
< sortSpecification(null)
< orderByFragment(null)
{code}
Tracing through the debugger leads me to the AbstractCollectionPersister
{code}
if ( hasOrder ) {
ColumnMapper mapper = new ColumnMapper() {
public String[] map(String reference) {
return elementPropertyMapping.toColumns( reference );
}
};
sqlOrderByStringTemplate = Template.renderOrderByStringTemplate(
collection.getOrderBy(),
mapper,
factory,
dialect,
factory.getSqlFunctionRegistry()
);
}
{code}
the Template.renderOrder call eventually creates an OrderByFragmentTranslator which
calls
{code}
GeneratedOrderByFragmentRenderer renderer = new GeneratedOrderByFragmentRenderer();
try {
renderer.orderByFragment( parser.getAST() );
}
{code}
The GeneratedOrderByFragmentRenderer makes a call to the traceIn and traceOut methods of
the antlr.TreeParser which seem to be dumping these values to System.out.println()
I do notice that there is an OrderByFragmentRenderer that isn't used by the core code
that seems to override these methods and log the output to log.trace().
Should the GeneratedOrderByFragmentRenderer be using that class instead? It's not
that big of a deal but it is rather ugly at startup.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira