<findBy when there could be more than one> I'm usi...
# questions
r
findBy when there could be more than one I'm using a findBy query in a grails/gorm project, where there is usually only one result (and I only ever want one result). However, there could occasionally be two (or even three theoretically, though it hasn't happened yet). How can I tell GORM which one to return, when there are more than one? I'm looking these up by an ID in an external system, which will eventually roll back around when it hits a max, so we can have two rows in our data base for the same external ID. I will always want...
j
Use findAllBy and if there are any results, use the first. Unless there is a specific reason to use one rather than another?