org.hibernate.criterion

Class SQLCriterion

Implemented Interfaces:
Criterion, Serializable

public class SQLCriterion
extends java.lang.Object
implements Criterion

A SQL fragment. The string {alias} will be replaced by the alias of the root entity.

Constructor Summary

SQLCriterion(String sql, Object[] values, Type[] types)

Method Summary

TypedValue[]
getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
Return typed values for all parameters in the rendered SQL fragment
String
toSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
Render the SQL fragment
String
toString()

Constructor Details

SQLCriterion

protected SQLCriterion(String sql,
                       Object[] values,
                       Type[] types)

Method Details

getTypedValues

public TypedValue[] getTypedValues(Criteria criteria,
                                   CriteriaQuery criteriaQuery)
            throws HibernateException
Return typed values for all parameters in the rendered SQL fragment
Specified by:
getTypedValues in interface Criterion
Parameters:
criteria - The local criteria
criteriaQuery - The overal criteria query
Returns:
The types values (for binding)
Throws:
HibernateException - Problem determining types.

toSqlString

public String toSqlString(Criteria criteria,
                          CriteriaQuery criteriaQuery)
            throws HibernateException
Render the SQL fragment
Specified by:
toSqlString in interface Criterion
Parameters:
criteria - The local criteria
criteriaQuery - The overal criteria query
Returns:
The generated SQL fragment
Throws:
HibernateException - Problem during rendering.

toString

public String toString()