简体   繁体   English

App Engine中的实体和持久对象之间有什么区别?

[英]What is the difference between an Entity and a Persistent Object in App Engine?

I am fairly new to App Engine and I am trying to figure out how to store and retrieve data. 我对App Engine还是相当陌生,我正在尝试弄清楚如何存储和检索数据。 However, I am confused about the difference between a java class marked with @Entity(name="name") and a class marked with @PersistenceCapable. 但是,我对标有@Entity(name =“ name”)的java类和标有@PersistenceCapable的类之间的区别感到困惑。 What is the difference between these two if I am trying to store something which can be sent off to a client? 如果我要存储可以发送给客户端的内容,那么两者之间有什么区别? For example, if I have an API which makes a list of Cars available for rental, would I use an Entity or a PersistenceCapable class for the Car object? 例如,如果我有一个API,该API可以列出可供租借的汽车列表,那么我可以对Car对象使用Entity还是PersistenceCapable类?

I believe @Entity is part of JPA and @PersistencCapable is JDO. 我相信@Entity是JPA的一部分,而@PersistencCapable是JDO。 Hence you might want to read this discussion about JPA vs JDO: https://db.apache.org/jdo/jdo_v_jpa.html 因此,您可能想阅读有关JPA与JDO的讨论: https : //db.apache.org/jdo/jdo_v_jpa.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM