Having an issue using Query By Example to retrieve a particular record and not sure why it's behaving as it is. After looking at the generated SQL, it appears it's not actually querying on the fields I'm populating on my example object.
E.g.
def exampleObject = new User(account:account,product
roduct)
def foundObject = User.find(exampleObject)
// this returns null and the SQL doesn't even look at the fields I've passed in..
However the criteria search below behaves correctly and returns the expected record(instance)
def foundObject = User.withCriteria {
eq('account',account)
eq('product',product)
}?.get(0)
A little puzzling, but i'm wondering whether QBE only works with basic field types and not associations.
E.g.
def exampleObject = new User(account:account,product
def foundObject = User.find(exampleObject)
// this returns null and the SQL doesn't even look at the fields I've passed in..
However the criteria search below behaves correctly and returns the expected record(instance)
def foundObject = User.withCriteria {
eq('account',account)
eq('product',product)
}?.get(0)
A little puzzling, but i'm wondering whether QBE only works with basic field types and not associations.