Anyone working on the Android ('gPhone') have or know of a place where I can find a good ORM tool for it? The code is written in Java, and the database is SQLite. What I would like to find is a tool that given the object definition, can auto-generate the tables and the CRUD functions (that would be awesome), or, barring that, a tool that can take the table definition, the object definition, and auto-generate the CRUD functionality. The rub is that all of this must happen within the Android framework, which has its own conventions as to how database access works.


当前回答

https://github.com/ahmetalpbalkan/orman

Orman框架可能会帮助您。它是专门为此设计的,非常小巧实用。

其他回答

http://hadi.sourceforge.net

这个工具非常简单易用。

我自己的DroidParts /http://droidparts.org/刚刚发布了0.5版。它是一个DI/ORM库等等。 没有太多的文档,但是包含了一个示例应用程序。

我也在寻找Android上的ORM。我测试了ActiveAndroid, NeoDatis和db4o,我想我将使用最后两个中的一个。

NeoDatis和db4o非常相似,所以我想要一些建议来选择最好的一个。有人在他的项目中使用了其中之一吗?我将在免费和付费应用中使用它,但似乎这两款应用在Android上没有任何许可限制。

这里有一个基准测试,似乎说NeoDatis比db4o更快,但我不知道我们是否可以基于这一点得出我的观点。

来自Aptana的ActiveRecordJS是一个可以在gPhone上运行的Javascript ORM。它被设计用于Jaxer和Gears。当您使用Jaxer适配器时,您可以连接到SQLLite。

更新:我不认为我说清楚了,但ActiveRecordJS是一个运行客户端的ORM,这可能是你在gPhone上的一个优势。

我想在这里加上0.02美元关于我的ORMLite包。

它是Hibernate的轻量级替代品,并使用原生Android OS数据库调用来支持Android上的SQLite。它还支持在其他体系结构上使用JDBC的许多其他数据库类型。我们有一个针对ormite问题的Android邮件列表。