java - 玩!框架从现有实体生成 CRUD

标签 java playframework crud

我有一个现有的实体类,它已经从另一个类继承,而不是模型。 现有的实体类来自库(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/

相关文章:

java - Phantasia4(Java 客户端和 C 服务器)套接字超时

Java 泛型返回类型

ruby-on-rails - 带有 CRUD 方法调用的 RSpec 代码示例基础知识

java - 玩! JPA : Enforce not to create Entity on load

java - 使用单独的 Controller 进行拦截

java - 当我们已经拥有锁时,再次锁定可重入锁有何帮助?

macos - Playframework:在 mac 中找不到激活器命令

node.js - 使用 sequelize 和 node js 自动生成 CRUD

unit-testing - 测试未在 Play Framework 2.0 中执行

postgresql - 错误 : value seq is not a member of object slick. dbio.DBIO