来自带 Hibernate 注释的 Java POJO 的 Grails 应用程序

Grails application from Hibernate-annotated Java POJOs

我还是 Grails 的新手,有以下问题要问。

我想从 Hibernate 注释的 POJO 开始开发一个 grails 应用程序。 可以在 Hibernate 注释的 POJO 中定义我们的实体,然后在 Grails 框架中使用它们吗?

如果 Grails 不能直接使用带 Hibernate 注释的 Java POJO,可能会使用现成的工具将 Hibernate POJO 转换为 Grails 实体定义。

正如 @Yaraish 指出的那样,Grails 可以直接与带 Hibernate 注释的 Java classes 一起工作。

此外,可以通过将单独的验证规范 groovy 文件放在与 Java Class 相同的包中并遵循 Grails 的命名模式来自动关联该规范来增强这些功能与 Java class.

来自 @yaraish 引用的 Grails 页面: (使用 Hibernate-native 映射...)"You will be able to map Grails domain classes onto a wider range of legacy systems and have more flexibility in the creation of your database schema. Best of all, you will still be able to call all of the dynamic persistent and query methods provided by GORM!"