Reputation: 303
What is the difference between DAO and RuntimeExceptionDao using Ormlite-Android? When to use one and not other?
Upvotes: 1
Views: 880
Reputation: 5149
The documentation is very clear on the difference. A Dao
(see docs) refers to
Database Access Objects that handle the reading and writing a class from the database
Whilst a RuntimeExceptionDao
(see docs)
Proxy to a
Dao
that wraps eachException
and rethrows it asRuntimeException
. You can use this if your usage pattern is to ignore all exceptions. That's not a pattern that I like so it's not the default.
They do the same thing, apart from the RuntimeExceptionDao
will only ever throw a RuntimeException
- For more info on ORMLite, please refer to the ORMLite docs as they are actually really helpful.
Upvotes: 3