[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-5064) OrderBy string getting dumped to console on session factory creation (Shawn Clowater)

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Jul 16 15:43:18 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-5064.
-------------------------------


> OrderBy string getting dumped to console on session factory creation (Shawn Clowater)
> -------------------------------------------------------------------------------------
>
>                 Key: HHH-5064
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5064
>             Project: Hibernate Core
>          Issue Type: Patch
>          Components: core
>    Affects Versions: 3.5.0-Final
>            Reporter: Shawn Clowater
>            Assignee: Steve Ebersole
>            Priority: Trivial
>             Fix For: 3.5.2, 3.6
>
>         Attachments: HHH-5064.patch
>
>          Time Spent: 5m
>  Remaining Estimate: 0h
>
> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list