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框架可能会帮助您。它是专门为此设计的,非常小巧实用。
其他回答
我自己的DroidParts /http://droidparts.org/刚刚发布了0.5版。它是一个DI/ORM库等等。 没有太多的文档,但是包含了一个示例应用程序。
我不知道你到底想要什么,但是如果你的体系结构需求是灵活的,有一个替代SQLite的选择,你可能会发现它很有用。db4o可能值得一试:
Android db4o 代码比较示例
来自Aptana的ActiveRecordJS是一个可以在gPhone上运行的Javascript ORM。它被设计用于Jaxer和Gears。当您使用Jaxer适配器时,您可以连接到SQLLite。
更新:我不认为我说清楚了,但ActiveRecordJS是一个运行客户端的ORM,这可能是你在gPhone上的一个优势。
ActiveAndroid(20美元)看起来可能正是你所需要的。
我也在寻找Android上的ORM。我测试了ActiveAndroid, NeoDatis和db4o,我想我将使用最后两个中的一个。
NeoDatis和db4o非常相似,所以我想要一些建议来选择最好的一个。有人在他的项目中使用了其中之一吗?我将在免费和付费应用中使用它,但似乎这两款应用在Android上没有任何许可限制。
这里有一个基准测试,似乎说NeoDatis比db4o更快,但我不知道我们是否可以基于这一点得出我的观点。
推荐文章
- 使用Jackson将JSON字符串转换为漂亮的打印JSON输出
- Android - SPAN_EXCLUSIVE_EXCLUSIVE跨度不能为零长度
- TextView的字体大小在Android应用程序改变字体大小从本机设置
- 如何模拟Android杀死我的进程
- Javadoc @see或{@link}?
- 在准备语句中使用“like”通配符
- 禁用EditText闪烁光标
- Android Eclipse -无法找到*.apk
- 设置TextView文本从html格式的字符串资源在XML
- javac和Eclipse编译器之间的区别是什么?
- 工厂模式和策略模式之间的区别是什么?
- 在Java中使用正则表达式提取值
- 如何转储一些SQLite3表的数据?
- 如何允许所有网络连接类型HTTP和HTTPS在Android(9)馅饼?
- Android加载JS包失败