Most OpenMRS objects, especially since the advent of REST, have get<T>byUuid 
methods with signatures declaring that they throw an API exception, but get the 
object by using a parameter query with .uniqueResult() and without a try-catch 
block.  .uniqueResult returns null if there is no match and throws a Hibernate 
exception if there are multiple results.  We rely on a unique DB constraint to 
keep the results singular, so perhaps a try-catch loop to change from a 
Hibernate to an API exception is unnecessary, but in that case there’s no 
circumstance where the API Exception would be thrown.  Could someone confirm 
that returning null rather than throwing the exception is the desired behavior?

Reply via email to