gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 00:16:11 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com