0

A desktop version of our software uses a relational database with Java Persistence API. We want to port the software to Android while keeping the relational database model. So is it possible to integrate a relational database with Java Persistence into an Android app?

1 Answer 1

1

Java Persistence as in Hibernate, EclipseLink, etc., no. There are however lightweight ORM solutions that work on Android such as OrmLite if you really feel you need to use ORM.

Sign up to request clarification or add additional context in comments.

4 Comments

I looked at OrmLite but it won't work for us because while looking around in the documentation it stated, "ORMLite does not enforce the many or one relationship nor does it use any of the annotation fields," and we use the many to one and one to many relationships.
You might find an ORM that supports those and works on Android, but you should really forget about using your model as is. Even if you manage to get it to work, it will probably be quite slow. Your best bet is to keep the domain model, and more or less give up on ORM.
What would be the difference if I kept the domain model and gave up on ORM?
Porting should still be relatively easy (same model) and you would not need to depend on JPA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.