I'd like to use myBatis (iBatis 3) in an Android application. Has anyo开发者_运维知识库ne tried such a thing or know of any resources for this?
aBatis is a data mapper framework available for Android
that couples objects with stored procedures or
SQL statements using an XML descriptor or annotations.
aBatis is like an Android equivalent of iBatis.
---simple & light ORM library like iBatis for Web development
--carrying ibatis's feature
--easy-to-use as iBatis
--shorten a development period
--independent of development phase
--Android sdk1.6 and up
http://sonixlabs.com/abatis/
The first thing to do in order to do that is to compile myBatis for Dalvik. But it's likely to be too heavy for a device like a smartphone.
If you are looking for a lightweight persistence layer, you could look at Ammentos:
http://www.ammentos.org/
Same trouble: you will need to compile it for Dalvik.
Existing ORMs for Android:
http://ormlite.sourceforge.net/sqlite_java_android_orm.html
https://www.activeandroid.com/
It's better to use lightweight lib in android apps like greenDAO or Ormlite, greenDAO is an open source project to help Android developers working with data stored in SQLite. SQLite is an awesome embedded relational database. However, developing for it requires alot of additional work. Writing SQL and parsing query results are quite tedious tasks. greenDAO will do the work for you: it maps Java objects to database tables (often called ORM). This way you can store, update, delete, and query for Java objects using a simple object oriented API. Save time and focus on real problems! greenDAO’s primary design goals
- Maximum performance (probably the fastest ORM for Android)
- Easy to use APIs Highly optimized for Android Minimal memory consumption
- Small library size, focus on the essentials
I create simple android project that using mybatis
check this: https://github.com/gustaroska/HijrDroid
精彩评论