我有一个现有的实体类,它已经从另一个类继承,而不是模型。 现有的实体类来自库(jar),这意味着我无法更改它们。
我还能使用 Play! 的 CRUD 方法吗?框架?
我该怎么做?
谢谢
最佳答案
来自 http://docs.oracle.com/javaee/5/tutorial/doc/bnbqa.html#bnbqr
非实体父类(super class)
Entities may have non-entity superclasses, and these superclasses can be either abstract or concrete. The state of non-entity superclasses is non-persistent, and any state inherited from the non-entity superclass by an entity class is non-persistent. Non-entity superclasses may not be used in EntityManager or Query operations. Any mapping or relationship annotations in non-entity superclasses are ignored.
我相信唯一的方法是你的 super 类也用 @MappedSuperClass 注释
关于java - 玩!框架从现有实体生成 CRUD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8988976/