Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有可能从使用 GreenDAO 的 Android 项目动态(在运行时)访问生成器项目中定义的数据库模型结构信息(实体、属性、模式......)?
我的第一印象是这是不可能的。如果是,我该怎么做?
感谢您的回答。
你可以通过反射来做。
DaoMaster的父级,AbstractDaoMaster有一个私有字段daoConfigMap,其中包括表的配置。
DaoMaster
AbstractDaoMaster
daoConfigMap
不是正确的方法,但如果您尝试破解某事,则可能。
另一种方法,如果你想访问 know dao 等的属性,每个生成的Dao类都有一个Properties定义属性的公共静态类。
Dao
Properties