Original Reporter: sjwhyte
Environment: Linux
Version: 1.3.3
Migrated From: http://jira.grails.org/browse/GPMONGODB-340
When trying to retrieve a domain object:
{code:title=}
class Device {
ObjectId id
Organization organization
User assignedUser
}
{code}
and by doing a findById as with a domain object like :
{code}
//Trying with a String
def deviceId = "2e:20:8b:40:4e:01"
Device.find(deviceId)
{code}
I get a groovy.lang.MissingMethodException: No signature of method: static com.xoeye.Device.findById() is applicable for argument types: (java.lang.String) values: [2e:20:8b:40:4e:01]
Possible solutions: find(), findAll(), find(groovy.lang.Closure), findAll(groovy.lang.Closure)
When I try to do it the following way:
{code}
//Trying with a String
def deviceId = new ObjectId("2e:20:8b:40:4e:01")
Device.find(deviceId)
{code}
The Mongo-Java driver throws an IllegalArgumentException because the isValid method on the ObjectId class does not allow ":" in the id and my string is less than 24 bits.