15

I found a post from a while ago that addresses a similar question but I think it's a bit outdated. I realize implementations of JPA tend to be more on the heavy/dense side, so if you know of any lightweight (non-JPA) ORMs I'll most certainly appreciate your input. I did see the answer about ActiveAndroid in the other post and am curious to know if anyone tried it out.

Update:

In the end, I decided to go with a more lightweight solution and chose DB4O. So far I've been very happy with my choice. It's extremely easy to use and requires a minimal amount of configuration. The website contains a wealth of information including sample projects and an in-depth tutorial that covers just about everything a developer might need to know about DB4O. Oh, and did I mention that it's free (unlike some other alternatives... coughActiveDroidcough)?

Community
  • 1
  • 1
Andrey
  • 8,882
  • 10
  • 58
  • 82
  • I'm curious if you looked at ORMLite and why you didn't choose it @Andrey? – Gray Sep 28 '11 at 19:33
  • @Gray - I did take a look at it. As a matter of fact, one of my friends has used it in one of his android apps and recommended it. The main reason I went with DB4O is because it requires virtually zero configuration. The second reason is reluctance to learn a new framework that ever-so-closely resembles JPA. There is also a third reason: the desire to explore an alternative to a relational database and see how it holds up in practice. – Andrey Sep 29 '11 at 15:56
  • 1
    @Gray - to expand on my second reason: on one hand, ORMLight follows patterns that are similar to JPA, but on the other, while concepts are the same, the syntax is different and since I deal with JPA on a daily basis at work I didn't want to confuse myself with a new set of annotations that does the same thing. – Andrey Sep 29 '11 at 15:56
  • All good reasons @Andrey. Thanks much for the response. I was just curious. :-) ORMLite only supports a subset of the JPA annotations at this time. Let me know if there is something that we can do to improve it. – Gray Sep 29 '11 at 19:18

3 Answers3

13

Regarding JPA implementations, there is at least a third party Dialect for SQLite for Hibernate. I'm not 100% sure but EclipseLink seems to be an option too (although SQLite is not officially supported).

But for Android development, I would definitely check ActiveAndroid.

Just in case, here are some other alternatives: jPersist, Ebean, Dreamsource ORM (have a look at the announcement on TSS).

Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124
4

ORMLite is not fully JPA compliant but it does support Sqlite on Android. It makes calls to the native Android OS database APIs to support its ORM functionality. We have a large number of Android users who are using it very successfully.

http://ormlite.com/sqlite_java_android_orm.shtml

Gray
  • 115,027
  • 24
  • 293
  • 354
0

BatooJPA is the only full featured JPA 2.0 spec compliant option. For mobile platforms, CPU consumption should be consider because of battery life limited CPU power etc. BatooJPA is perfect when full spec required and CPU resource does matters. For the SQLite case as far as you can provide a JDBC driver, Batoo JPA will do the rest.

asimarslan
  • 235
  • 1
  • 6