简体   繁体   English

Grails GORM Rest插件和Hibernate

[英]Grails GORM Rest Plugin and Hibernate

How can I explicitly set the domain class to be mapped with the GORM REST plugin, so I can still use the hibernate plugin for other domain classes. 如何显式设置要使用GORM REST插件映射的域类,因此我仍然可以将hibernate插件用于其他域类。

Because I get an error when I don't remove the hibernate plugin. 因为当我不删除hibernate插件时出现错误。

If you have more than one gorm mapper installed you can tell grails which to use with mappedWith 如果你安装了多个gorm mapper,你可以告诉grails使用mappedWith

Add the following to the domain object. 将以下内容添加到域对象。

static mappedWith = "restclient"

For the Rest gorm plugin you will still need the set the URL of the resource. 对于Rest gorm插件,您仍然需要设置资源的URL。

static mapping = {
    url "http://localhost:8080/amazon/books"
}

See the guide . 请参阅指南

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

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