add new findX(query, args) method to return unique result
|Assignee:||Arnaud Thimel||% Done:|
Like find(String, int, int, args) and findAll(String, args) add
new method to return only one result.
- Status changed from Nouveau to Assigné
- Assignee set to Arnaud Thimel
- Status changed from Assigné to Commentaire
- Assignee changed from Arnaud Thimel to Éric Chatellier
What is your expected behaviour if there is more than 1 result ?
What is your expected behaviour if there is 0 result ?
I don't have opinion on that.
Maybe for now we could take same behaviour as
- exception for non unique result
- null for no result
As a former user of the Hibernate method, I would have say the exact opposite :
- returns only the 1st element (easier to developp, better perfs)
- if no result, simply return null (easier to use against an exception)
Do you agree on that ?
- Status changed from Commentaire to Assigné
- Assignee changed from Éric Chatellier to Arnaud Thimel
I will implement that :
- if no result, return "null"
- if more than 1 result, throw an exception
- Status changed from Assigné to Résolu
- % Done changed from 0 to 100
Appliqué par commit r2573.
Also available in: Atom