public final class HibernateDetachedCriteriaExtension extends java.lang.Object
Groovy extension methods that add sqlRestriction to detached criteria, registered in
META-INF/services/org.codehaus.groovy.runtime.ExtensionModule. The and, or and not
blocks of a criteria query, and the association blocks inside them, resolve their calls against a detached
criteria, so a sqlRestriction in such a block restricts the criteria it is called in. The same methods
restrict a grails.gorm.DetachedCriteria of a Hibernate entity.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static org.grails.datastore.mapping.query.api.Criteria |
sqlRestriction(org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria<?> self, java.lang.String sqlRestriction)Restricts the results with a native SQL condition. |
|
public static org.grails.datastore.mapping.query.api.Criteria |
sqlRestriction(org.grails.datastore.gorm.query.criteria.AbstractDetachedCriteria<?> self, java.lang.String sqlRestriction, java.util.List<?> values)Restricts the results with a native SQL condition whose ? |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Restricts the results with a native SQL condition. {alias} in the SQL stands for the table alias of
the criteria's entity.
self - the detached criteriasqlRestriction - the SQL condition Restricts the results with a native SQL condition whose ? placeholders are bound to the given values.
{alias} in the SQL stands for the table alias of the criteria's entity.
? placeholders differs from the number of values,
or a value is nullself - the detached criteriasqlRestriction - the SQL conditionvalues - the values of the ? placeholders, in order, none of them null