简体   繁体   English

玩! Framework从现有实体生成CRUD

[英]Play! Framework generate the CRUD from existing Entity

I have an existing Entity class that already inherits from another class, not model. 我有一个已经从另一个类继承的现有Entity类,而不是模型。 The existing entity class comes from libraries (jar), that means that I can not change them. 现有的实体类来自库(jar),这意味着我无法更改它们。

Can I still use the CRUD approach of Play! 我还可以使用Play的CRUD方法吗? Framework? 框架?

how can i do it? 我该怎么做?

thank you 谢谢

from http://docs.oracle.com/javaee/5/tutorial/doc/bnbqa.html#bnbqr 来自http://docs.oracle.com/javaee/5/tutorial/doc/bnbqa.html#bnbqr

Non-Entity Superclasses 非实体超类

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. 非实体超类不能在EntityManager或Query操作中使用。 Any mapping or relationship annotations in non-entity superclasses are ignored. 忽略非实体超类中的任何映射或关系注释。

I believe the only way is too have you super class annotated with @MappedSuperClass 我相信唯一的方法是你用@MappedSuperClass注释超类

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

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