Top Description Inners Fields Constructors Methods
org.hibernate.sql.ordering.antlr

public Class OrderByFragmentTranslator

extends Object
Class Inheritance
Imports
java.io.StringReader, java.util.Set, org.hibernate.HibernateException, org.hibernate.hql.internal.ast.util.ASTPrinter, .TokenPrinters, org.jboss.logging.Logger

A translator for order-by mappings, whether specified by hbm.xml files, Hibernate org.hibernate.annotations.OrderBy annotation or JPA javax.persistence.OrderBy annotation.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static OrderByTranslation

Returns:

The translation.
translate
(TranslationContext
Context giving access to delegates needed during translation.
context
,
String
The user-supplied order-by fragment
fragment
)

Perform the translation of the user-supplied fragment, returning the translation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

OrderByFragmentTranslatorback to summary
public OrderByFragmentTranslator()

Method Detail

translateback to summary
public static OrderByTranslation translate(TranslationContext context, String fragment)

Perform the translation of the user-supplied fragment, returning the translation.

The important distinction to this split between (1) translating and (2) resolving aliases is that both happen at different times

Parameters
context:TranslationContext

Context giving access to delegates needed during translation.

fragment:String

The user-supplied order-by fragment

Returns:OrderByTranslation

The translation.

org.hibernate.sql.ordering.antlr back to summary

public Class OrderByFragmentTranslator.StandardOrderByTranslationImpl

extends Object
implements OrderByTranslation
Class Inheritance
  • java.lang.Object
  • org.hibernate.sql.ordering.antlr.OrderByFragmentTranslator.StandardOrderByTranslationImpl
All Implemented Interfaces
org.hibernate.sql.ordering.antlr.OrderByTranslation

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final String

Constructor Summary

AccessConstructor and Description
public
StandardOrderByTranslationImpl(String sqlTemplate, Set<String> columnReferences)

Method Summary

Modifier and TypeMethod and Description
public String
injectAliases(OrderByAliasResolver
The strategy to resolver the proper table alias to use per column
aliasResolver
)

Implements org.hibernate.sql.ordering.antlr.OrderByTranslation.injectAliases.

Inject table aliases into the translated fragment to properly qualify column references, using the given 'aliasResolver' to determine the the proper table alias to use for each column reference.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnReferencesback to summary
private final Set<String> columnReferences
sqlTemplateback to summary
private final String sqlTemplate

Constructor Detail

StandardOrderByTranslationImplback to summary
public StandardOrderByTranslationImpl(String sqlTemplate, Set<String> columnReferences)

Method Detail

injectAliasesback to summary
public String injectAliases(OrderByAliasResolver aliasResolver)

Implements org.hibernate.sql.ordering.antlr.OrderByTranslation.injectAliases.

Doc from org.hibernate.sql.ordering.antlr.OrderByTranslation.injectAliases.

Inject table aliases into the translated fragment to properly qualify column references, using the given 'aliasResolver' to determine the the proper table alias to use for each column reference.

Parameters
aliasResolver:OrderByAliasResolver

The strategy to resolver the proper table alias to use per column

Returns:String

The fully translated and replaced fragment.

Annotations
@Override