Grails support for DB reverse engineering?

  1. MyEclipse IDE
  2.  > 
  3. Feature Requests
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #600278 Reply


    Are there any plans to implement the current DB reverse engineering tools for Grails applications?

    #600296 Reply

    Brian Fernandes

    There are no plans to to generate code for Grails applications. Can you give us an example of the output you would like generated? GORM, GORM for Hibernate?


    #600360 Reply


    Hi Brian,
    Yes GORM. The reverse engineering for Grails is a little simpler because all that is needed are Domain classes and the framework handles all the hibernate mappings. So for example a DB table called Application would only need a single Domain class instead of a Domain, DAO and XML Mapping file. Here is an example with one-to-many and many-to-one relationships

    class Application {
    	BigDecimal gpa
    	Date submitDate
    	String appliedFlag
    	String acceptedFlag
    	String deniedFlag
    	String managerNetid
    	Date timeStamp
    	AcademicYear academicYear
    	Quarter quarter
    	Student student
    	Set<ApplicationFile> applicationFiles = []
    	Set<ApplicationQa> applicationQas = []
    	Set<ApplicationAccepted> applicationAccepteds = []
    	Set<ApplicationDenied> applicationDenieds = []
    	static hasMany = [applicationAccepteds: ApplicationAccepted,
    	                  applicationDenieds: ApplicationDenied,
    	                  applicationFiles: ApplicationFile,
    	                  applicationQas: ApplicationQa]
    	static belongsTo = [AcademicYear, Quarter, Student]
    	static mapping = {
    		version false
    		quarter column: "quarter_code"
    		student column: "sid"
    		applicationAccepteds cascade: "save-update, delete-orphan"
    		applicationDenieds cascade: "save-update, delete-orphan"
    		applicationQas cascade: "save-update"
    	static constraints = {
    		submitDate nullable: true
    		appliedFlag maxSize: 1
    		acceptedFlag maxSize: 1
    		deniedFlag maxSize: 1
    		managerNetid nullable: true, maxSize: 36

    There used to be a plugin for Grails that had this functionality and uses the hibernate-tools library but it stopped being maintained a while ago and the newer Grail releases are not compatible. I figured since MyEclipse uses the same hibernate-tools to generate Java code that maybe it would be possible to expand on that to generate Grails domain classes?


    #601059 Reply

    Brian Fernandes


    I thought I had replied earlier, apologies.

    Thank you for taking the time to provide the example – gives us a better understanding of what you’d like implemented. The fact that the Grails plugin depends on hibernate-tools will make it easier, but it is still a non trivial task.

    I’ll file this with your details, but to be upfront I don’t see this as something our team will be able to get to in the near future.

    Thank you for sending in the request.

    #601081 Reply


    Understood, thanks for at least submitting the request for me.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Grails support for DB reverse engineering?

You must be logged in to post in the forum log in