问题描述:

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

网友答案:

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.

相关阅读:
Top