我正在嘗試完成我計劃在Google應用引擎上部署的應用程序的建模。GAA的JPA註釋/元數據映射
我有一個基類,帳戶是抽象的,註釋如下:
@Entity
@MappedSuperclass
public abstract class Account {
@Id
private Key id;
.....
我然後有2個具體的類,AdministratorAccount:
@Entity
public class AdministratorAccount extends Account {
和CustomerAccount:
@Entity
public class CustomerAccount extends Account {
我也有我的persistence.xml文件中聲明的所有3。
當我嘗試堅持一個CustomerAccount,我得到一個500錯誤:
org.datanucleus.exceptions.NoPersistenceInformationException: The class "com.nucleus.entitymodel.Account" is required to be persistable yet no Meta-Data/Annotations can be found for this class. Please check that the Meta-Data/annotations is defined in a valid file location.
的問題可能是什麼任何想法?我試圖按照GAE站點上的文檔來獲得JPA繼承。
沒有類應該有實體和MappedSuperclass有史以來。日誌會告訴你什麼是已知的類。你也在使用古老的軟件。 –
我用什麼軟件是古老的?另外,我從google文檔中得到了這個例子:https://cloud.google.com/appengine/docs/java/datastore/jpa/overview – user1154644
如果您看一下Worker.java示例,它顯然具有映射超類和實體註釋。 – user1154644