Usman Maqsood
Usman Maqsood

Reputation: 303

DAO vs RuntimeExceptionDao ORMLite Android?

What is the difference between DAO and RuntimeExceptionDao using Ormlite-Android? When to use one and not other?

Upvotes: 1

Views: 880

Answers (1)

Ed Holloway-George
Ed Holloway-George

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 each Exception and rethrows it as RuntimeException. 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

Related Questions