Hello there,
As the OrmLite project does not support direct creation of custom RuntimeExceptionDaos by itself using e.g. helper.getRuntimeExceptionDao() we implemented that feature in a similar way getRuntimeExceptionDao() works but with instantiating the custom class directly.
this is how the current generated code looks like.
try {
runtimeExceptionDao = new RuntimeExceptionDao<Car, Long>((Dao<Car, Long>) databaseHelper_.getDao(Car.class));
} catch (SQLException e) {
Log.e("OrmLiteActivity_", "Could not create DAO runtimeExceptionDao", e);
}
try {
userRuntimeExceptionDao = new UserRuntimeExceptionDao((Dao<User, Long>) databaseHelper_.getDao(User.class));
} catch (SQLException e) {
Log.e("OrmLiteActivity_", "Could not create DAO userRuntimeExceptionDao", e);
}
the question is now. is this a good practice? or do you suggest something else.
Thanks! :)