How to extend the BaseDaoImpl class of ORMLite on Android to extend functionality

后端 未结 1 1836
轻奢々
轻奢々 2020-12-30 04:42

I\'m wondering whether there\'s a way to extend the BaseDaoImpl class of ORMLite on Android. In my Android project I\'m using several different Dao objects to access the dif

相关标签:
1条回答
  • 2020-12-30 05:29

    My problem is that I don't know how to create an instance of ExtendedDaoImpl class form the OrmLiteSqliteOpenHelper class...

    Nicely worded question. The @DatabaseTable annotation has a field daoClass which can be used to specify the DAO class to construct.

    http://ormlite.com/javadoc/ormlite-core/com/j256/ormlite/table/DatabaseTable.html#daoClass()

    Here are the docs for the DaoManager.

    http://ormlite.com/docs/dao-manager

    Your class will need to have a constructor with ConnectionSource and Class arguments.

    The solution is not well documented. Let me know if you have any ideas how I can improve the documentation.

    0 讨论(0)
提交回复
热议问题