OrmLite 创建此生成的文件,并且说明要求在 CTOR 中使用它。
但是我们还是需要自己创建所有的表并设置如何升级数据库,如the instructions所示并在sample app上.
我的问题是:为什么我们需要这个文件?即使没有它,该应用程序似乎也可以正常工作。 难道不应该使用它来自动创建/修改所需的表吗?
很抱歉没有找到它,因为在 OrmLite 网站中导航非常困难。
最佳答案
why do we need this [ormlite_config.txt] file?
这可以通过查看 Android documentation 找到。引用:
For some time we have been struggling with DAO startup [performance]... Turns out that one of the major culprits is some ugly code down in the Android OS [annotations].
... ORMLite supports the loading of the data configurations from a text configuration file. When a DAO is created, these configurations will be used, removing the need for any annotation method calls entirely.
配置文件配置代码中使用的实体。但是,它不会自动创建表或 DAO 类。加载实体后,可以非常轻松地使用 TableUtils
类创建表等。
我在 ORMLite 文档上花费了大量时间,但仍然有人说以下内容。压抑。我很乐意考虑有关如何改进网站的具体建议。
Sorry for not finding it, as it's quite hard to navigate in the OrmLite website.
您可以通过查看 online documentation 在文档中找到此内容用于:
- 表的配置文件
- 安卓性能
- 数据库配置文件
或者您可以在目录中查找 "Using Table Config File" .
关于android - OrmLite 生成的 "ormlite_config.txt"文件的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26717103/