Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Persistence
-
Labels:None
Description
We often need a sample instance from a domain class when trying some implementation on Grails console or shell.
This is so often that most ORMs out there for Ruby and Python will provide a "first" and "last" methods (maybe with different names).
Unless the order is specified in "order" mapping, "id" should be used for the "ORDER BY" SQL clause.
Currently, I often need to write things like MyDomain.findByIdIsNotNull() when I want a single sample. It should be easier with MyDomain.first() or MyDomain.last().
This should not be "Major" or "Bug"