Hibernate ORM ASTPrinter - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM ASTPrinter class.

This code example shows how to use the following methods:showAsString
		catch ( Throwable t ) { 
			throw new HibernateException( "Unable to parse order-by fragment", t ); 
		} 
 
        if (LOG.isTraceEnabled()) { 
			ASTPrinter printer = new ASTPrinter( OrderByTemplateTokenTypes.class ); 
            LOG.trace(printer.showAsString(parser.getAST(), "--- {order-by fragment} ---")); 
		} 
 
		OrderByFragmentRenderer renderer = new OrderByFragmentRenderer(); 
		try { 
			renderer.orderByFragment( parser.getAST() ); 
		} 
		catch ( HibernateException e ) { 
			throw e; 
		} 
		catch ( Throwable t ) { 
			throw new HibernateException( "Unable to render parsed order-by fragment", t ); 
		} 
 
5
CodeRank
This code example shows how to use the following methods:
 */ 
public class OrderByFragmentRenderer extends GeneratedOrderByFragmentRenderer { 
 
    private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, 
                                                                       OrderByFragmentRenderer.class.getName()); 
	private static final ASTPrinter printer = new ASTPrinter( GeneratedOrderByFragmentRendererTokenTypes.class ); 
 
	@Override 
    protected void out(AST ast) { 
		out( ( ( Node ) ast ).getRenderableText() ); 
	} 
 
 
	// handle trace logging ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 
    private int traceDepth = 0; 
 
	@Override 
    public void traceIn(String ruleName, AST tree) { 
		if ( inputState.guessing > 0 ) { 
4
CodeRank
See Code Examples for Hibernate ORM ASTPrinter Methods: