android - OrmLite 生成的 "ormlite_config.txt"文件的用途是什么?

标签 android ormlite

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/

相关文章:

java - 为什么我的 Intent 没有正确传递?

android - 在android上使用ormlite删除?

android - 如何使用垂直 GridLayoutManager 水平居中 RecyclerView 项目

android - 连接到 ros master

android - Meteor 应用程序,如果我们添加一个新的 cordova 插件,我们是否必须重新提交该应用程序或由 meter hotcode push 处理?

java - 为什么 ".contains"会为直接从集合中提取的对象返回 false?

android - 如何在 android 上使用 ormLite 注释引用外部对象

用于 ORMLite 配置生成的 Android Studio 运行配置

java - 使用 ORMLite 保存 PostgreSQL 自定义枚举数据类型

javascript - 使用 webview 从 JavaScript 调用 Android 中的 Java 方法