简体   繁体   中英

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.

Because I get an error when I don't remove the hibernate plugin.

If you have more than one gorm mapper installed you can tell grails which to use with 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.

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

See the guide .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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