Announcement Announcement Module
Collapse
No announcement yet.
Is it possible to generate class domain from existing database schema? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is it possible to generate class domain from existing database schema?

    Hello
    I want to know if it's possible to generate my domain classes from an existing database schema with grails?

    Best regards

  • #2
    Use the http://grails.org/plugin/db-reverse-engineer plugin. Make sure to use v0.3 for Grails 1.3 and v0.4 for Grails 2 as described in the docs.

    Comment


    • #3
      Thanks burtbeckwith for the link, on my way to check it out.
      Best regards

      Comment


      • #4
        I have tried this plugin on 2.0.0 RC3. Any pointers will be helpful..

        Set the configuration etc in Config.groovy and running the 'grails db-reverse-engineer', I get the following error:

        log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
        log4j:WARN Please initialize the log4j system properly.
        Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextAware
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader. java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java :615)
        at java.security.SecureClassLoader.defineClass(Secure ClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader .java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader. java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java: 197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at grails.plugin.reveng.Reenigne.class$(Reenigne.groo vy)
        at grails.plugin.reveng.Reenigne.$get$$class$grails$u til$GrailsUtil(Reenigne.groovy)
        at grails.plugin.reveng.Reenigne.execute(Reenigne.gro ovy:73)
        at grails.plugin.reveng.Reenigne$execute.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray .defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallS ite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallS ite.call(AbstractCallSite.java:112)
        at grails.plugin.reveng.RevengRunner.run(RevengRunner .groovy:81)
        at grails.plugin.reveng.RevengRunner$run.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray .defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallS ite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallS ite.call(AbstractCallSite.java:120)
        at grails.plugin.reveng.RevengRunner.main(RevengRunne r.groovy:28)
        Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextAwar e
        at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
        ... 27 more

        Comment


        • #5
          site i like

          Great post. I was checking continuously this blog and I'm impressed! Extremely useful information specially the last part I care for such info a lot. I was seeking this particular info for a very long time. Thank you and good luck.

          http://www.facebook.com/notes/electr...7731925?ref=nf
          http://www.facebook.com/notes/electr...1057252?ref=nf
          http://www.facebook.com/notes/electr...1065738?ref=nf
          http://www.facebook.com/notes/electr...4399398?ref=nf
          http://www.facebook.com/notes/electr...1066013?ref=nf

          Comment

          Working...
          X