[英]Using Hibernate or alternative with PostgreSQL on Android 4.0+
I need to use the database layer between Java code and Database without pain on both platforms PC and Android. 我需要在Java代码和数据库之间使用数据库层,而在PC和Android平台上都不会痛苦。 I would be very happy to stick with Hibernate if possible as I have PC application where database is connected by using Hibernate and there are many annotation inside my classes.
如果可能的话,我将很高兴坚持使用Hibernate,因为我有PC应用程序,该数据库使用Hibernate连接数据库,并且我的类中有很多注释。 Now I need to create Android application that would connect to the same database and the best option would be to reuse the same hibernate entities-code as on PC.
现在,我需要创建将连接到相同数据库的Android应用程序,最好的选择是重用与PC上相同的休眠实体代码。
Hibernate uses bytecode manipulation under the hood - and this is not available on android at runtime. Hibernate在后台使用字节码操作-这在运行时在android上不可用。 Better solution would be to let hibernate live on your server, and wrap your API in webservices
更好的解决方案是让休眠在您的服务器上运行,并将您的API包装在Web服务中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.