We have developed a web service and now are building an Android application to communicate with the web service. We use persistence in our web service and would also like to use persistence in our Android app. We figured that ORMLite was the way to go for persistency on Android and we are hoping that the javax.persistence support would be good enough for our app. I was hoping that I would be able to copy the web service’s data model to the Android app and not having to modify the annotations.
So I tried copying the model classes and adding ormlite-android-4.41.jar and ormlite-core-4.41.jar to my Android project. Unfortunately this did not do the trick. My IDE can’t find the classpaths for the javax.persistence annotations. Do I need additional libraries? I can’t anything on that in the documentation.
Interesting question. If the
javax.persistenceannotations aren’t in the Android JDK then I’m not sure you should be using them.That said, if you want to use them, you should be able to get the java files from a JDK source jar and include them in your own project. Just copy the annotations that you actually use out of the source jar into the appropriate
javax/persistencepath.The ORMLite support for the
javax.persistenceannotations is far from perfect. If you have any problems please let me know so I can improve them.