简体   繁体   中英

How to use existing java data bindings in grails?

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.

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