im using greenDAO to generate my DAO classes, everything works fine till i try to insert duplicated values for primary key.
It fails when i try to insert duplicated primery key (as expected), but i would like to send the exception to the user and not o explode with the app.
For now the only solution i have, and i think its not the best, is to do a query before insert, and check if the result count is greater than 0 or not.
There is a better way to do it?
the method .insert returns a Long value, but when it fails to insert it doesn't return anything, just explodes with the app.