类 Template
- java.lang.Object
-
- org.hibernate.sql.Template
-
public final class Template extends Object
Parses SQL fragments specified in mapping documents- 作者:
- Gavin King
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classTemplate.NoOpColumnMapper
-
字段概要
字段 修饰符和类型 字段 说明 static OrderByAliasResolverLEGACY_ORDER_BY_ALIAS_RESOLVERstatic StringTEMPLATE
-
方法概要
所有方法 静态方法 具体方法 已过时的方法 修饰符和类型 方法 说明 static StringrenderOrderByStringTemplate(String orderByFragment, Dialect dialect, SQLFunctionRegistry functionRegistry)static StringrenderOrderByStringTemplate(String orderByFragment, ColumnMapper columnMapper, SessionFactoryImplementor sessionFactory, Dialect dialect, SQLFunctionRegistry functionRegistry)static StringrenderTransformerReadFragment(String fragment, String... columnNames)static StringrenderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect)已过时。Only intended for annotations usage; userenderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry)insteadstatic StringrenderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect, SQLFunctionRegistry functionRegistry)Takes the where condition provided in the mapping attribute and interpolates the alias.static StringrenderWhereStringTemplate(String sqlWhereString, Dialect dialect, SQLFunctionRegistry functionRegistry)static OrderByTranslationtranslateOrderBy(String orderByFragment, ColumnMapper columnMapper, SessionFactoryImplementor sessionFactory, Dialect dialect, SQLFunctionRegistry functionRegistry)Performs order-by template rendering allowingcolumn mapping.
-
-
-
字段详细资料
-
LEGACY_ORDER_BY_ALIAS_RESOLVER
public static final OrderByAliasResolver LEGACY_ORDER_BY_ALIAS_RESOLVER
-
-
方法详细资料
-
renderTransformerReadFragment
public static String renderTransformerReadFragment(String fragment, String... columnNames)
-
renderWhereStringTemplate
public static String renderWhereStringTemplate(String sqlWhereString, Dialect dialect, SQLFunctionRegistry functionRegistry)
-
renderWhereStringTemplate
@Deprecated public static String renderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect)
已过时。Only intended for annotations usage; userenderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry)insteadSame functionality asrenderWhereStringTemplate(String, String, Dialect, SQLFunctionRegistry), except that a SQLFunctionRegistry is not provided (i.e., only the dialect-defined functions are considered). This is only intended for use by the annotations project until the many-to-many/map-key-from-target-table feature is pulled into core.
-
renderWhereStringTemplate
public static String renderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect, SQLFunctionRegistry functionRegistry)
Takes the where condition provided in the mapping attribute and interpolates the alias. Handles sub-selects, quoted identifiers, quoted strings, expressions, SQL functions, named parameters.- 参数:
sqlWhereString- The string into which to interpolate the placeholder valueplaceholder- The value to be interpolated into the the sqlWhereStringdialect- The dialect to applyfunctionRegistry- The registry of all sql functions- 返回:
- The rendered sql fragment
-
renderOrderByStringTemplate
@Deprecated public static String renderOrderByStringTemplate(String orderByFragment, Dialect dialect, SQLFunctionRegistry functionRegistry)
Performs order-by template rendering withoutcolumn mapping. An ORDER BY template has all column references "qualified" with a placeholder identified byTEMPLATE- 参数:
orderByFragment- The order-by fragment to render.dialect- The SQL dialect being used.functionRegistry- The SQL function registry- 返回:
- The rendered ORDER BY template.
-
renderOrderByStringTemplate
public static String renderOrderByStringTemplate(String orderByFragment, ColumnMapper columnMapper, SessionFactoryImplementor sessionFactory, Dialect dialect, SQLFunctionRegistry functionRegistry)
-
translateOrderBy
public static OrderByTranslation translateOrderBy(String orderByFragment, ColumnMapper columnMapper, SessionFactoryImplementor sessionFactory, Dialect dialect, SQLFunctionRegistry functionRegistry)
Performs order-by template rendering allowingcolumn mapping. An ORDER BY template has all column references "qualified" with a placeholder identified byTEMPLATEwhich can later be used to easily inject the SQL alias.- 参数:
orderByFragment- The order-by fragment to render.columnMapper- The column mapping strategy to use.sessionFactory- The session factory.dialect- The SQL dialect being used.functionRegistry- The SQL function registry- 返回:
- The rendered ORDER BY template.
-
-