In play framework the Anorm method using single and singleOpt. What is the difference between them?
As is often the case with methods suffixed with "opt", it means that it returns an Option. So the difference between those 2 methods is that singlewill treat the absence of result as an error, while singleOpt will just return None when there is no result (and the actual result wrapped in Some otherwise).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With