Improve conversion to OrmDuplicateException if appropriate

Improve or implement the conversion of SQL exception to instance of
OrmDuplicateException for all Jdbc dialects. Add unit tests for this
use case.

For more information about the bug on the mailing list
https://groups.google.com/d/topic/repo-discuss/Ix1oMCLGMtw/discussion

Change-Id: Ic5d507e8a4e896a0e038f7109f38013aa2e2c8a1
4 files changed