Handle constraint exception

13 views
Skip to first unread message

Diogo Soares

unread,
Dec 21, 2015, 12:35:17 PM12/21/15
to ORMLite Users
It's possible handle constraint exceptions?

I have a simple POJO class with the following constraint:

@DatabaseField(unique = true)
private String username;

After insert a username that already exists I receive the following exception:

[SQLITE_CONSTRAINT]  Abort due to constraint violation (column username is not unique)

It's possible catch and Iterate all the constraints violation properly?
What is the best way to differ them? I need to pass this information to the user...
Reply all
Reply to author
Forward
0 new messages