Package org.hibernate.sql
Class Template
java.lang.Object
org.hibernate.sql.Template
Parses SQL fragments specified in mapping documents
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringrenderOrderByStringTemplate(String orderByFragment, Dialect dialect, SQLFunctionRegistry functionRegistry) Deprecated.static StringrenderOrderByStringTemplate(String orderByFragment, ColumnMapper columnMapper, SessionFactoryImplementor sessionFactory, Dialect dialect, SQLFunctionRegistry functionRegistry) Performs order-by template rendering allowingcolumn mapping.static StringrenderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect) Deprecated.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)
-
Field Details
-
TEMPLATE
- See Also:
-
-
Method Details
-
renderWhereStringTemplate
public static String renderWhereStringTemplate(String sqlWhereString, Dialect dialect, SQLFunctionRegistry functionRegistry) -
renderWhereStringTemplate
public static String renderWhereStringTemplate(String sqlWhereString, String placeholder, Dialect dialect) Deprecated.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.- 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- Returns:
- The rendered sql fragment
-
renderOrderByStringTemplate
public static String renderOrderByStringTemplate(String orderByFragment, Dialect dialect, SQLFunctionRegistry functionRegistry) Deprecated.Performs order-by template rendering withoutcolumn mapping. An ORDER BY template has all column references "qualified" with a placeholder identified byTEMPLATE- Parameters:
orderByFragment- The order-by fragment to render.dialect- The SQL dialect being used.functionRegistry- The SQL function registry- Returns:
- The rendered ORDER BY template.
-
renderOrderByStringTemplate
public static String renderOrderByStringTemplate(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.- Parameters:
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- Returns:
- The rendered ORDER BY template.
-
renderOrderByStringTemplate(String,ColumnMapper,SessionFactoryImplementor,Dialect,SQLFunctionRegistry)instead