grailsgrails-ormgrails-plugingrails-domain-classgrails-controller

Grails read from existing DB


I want to fetch data from already existing database from another project into my Grails project and list the data. Should I be creating a domain controller for the already existing db? I know how to create domain-controller and use data migration plugin to update db but none of the books I read had any information on how to setup and read from an existing database. I'm using MySQL for my database.


Solution

  • Use the Reverse Engineer plugin to create domain classes from your existing database: https://plugins.grails.org/plugin/grails/db-reverse-engineer