Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1.1
-
Fix Version/s: 1.2-RC1
-
Component/s: Persistence
-
Labels:None
-
Environment:all
Description
The CriteriaBuilder API is missing the methods to evaluate a size of a non-collection property, or a hook to sqlRestriction to enable smth like:
sqlRestriction 'char_length( aField ) >= 444'
Issue Links
- relates to
-
GRAILS-9402
sqlProjection is not supported
-
Support for expressing sql restrictions has been added. The following should work now...
def results = Person.withCriteria { sqlRestriction "char_length( first_name ) <= 4" }Note that "first_name" refers to a column in the database, not necessarily the name of a domain property. This is SQL.