简体   繁体   English

在Android 4.0+上的PostgreSQL中使用Hibernate或替代品

[英]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上相同的休眠实体代码。

  • from what i know Hibernate is not supported on Android, does anyone made it working? 据我所知,Android不支持Hibernate,有人能使其工作吗?
  • is there any alternative to Hibernate on Android (db: PostgreSQL) that would support loading/saving complex entities/tables including nested @OneToMany @ManyToMany relationships? 在Android(db:PostgreSQL)上,Hibernate是否有其他替代方法可以支持加载/保存复杂的实体/表,包括嵌套的@OneToMany @ManyToMany关系?

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.

相关问题 Android 4.0+ EditText禁用自动更正 - Android 4.0+ EditText disable autocorrection httpclient(phpmyadmin)在Android 4.0+上不起作用 - httpclient (phpmyadmin) not working on Android 4.0+ 如何在Android 4.0+设备上以编程方式禁用“窗口动画比例”? - How to disable “Window animation scale” programmatically on Android 4.0+ devices? Android 4.0版中的外部SD卡路径读取文件 - External SD card path in android version 4.0+ to read files Android - MediaPlayer即使在Android 4.0+上准备流之前就准备好了 - Android - MediaPlayer's on Prepare Called even before the stream is prepared on Android 4.0+ 为什么在Android 4.0+上支持v7 actionbar进入屏幕底部 - Why support v7 actionbar goes to screen bottom on android 4.0+ 如何检查自动旋转屏幕设置是否在 Android 4.0+ 中打开/关闭 - How to check if auto-rotate screen setting is ON/OFF in Android 4.0+ 如何在4.0+上更改Edittext下划线的颜色? - How change color of the underline of Edittext on 4.0+? 在 facebook sdk 4.0+ 上获得可标记的朋友 - get taggable friends on facebook sdk 4.0+ 在Glassfish4.0中使用Hibernate 5.0.2 - Using hibernate 5.0.2 with glassfish4.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM