I need to add a new datasource to my grails project wich uses the musicbrainz postgresql database. http://musicbrainz.org/doc/MusicBrainz_Database

I found a project on github where the data bindings are ready to use for a spring project: https://github.com/lastfm/musicbrainz-data

Am i able to use these data bindings in a grails 2.2.3 project? If yes, how can i do this? (because there is no hibernate xml as needed by grails (regarding to the grails documentation: Hibernate Mapped Domain Classes))

有帮助吗?

解决方案

I don't think it will be. Just setup the additional datasource and model out the tables or objects you need.

How do you access two databases in Grails

Once you do that, you can use all of the GORM methods and dynamic finders to get your data. Plus validation criteria, transactions, etc. Unless there is some very specialized criteria that make it necessary to bypass GORM, I would suggest leveraging it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top