Grails Hibernate Plugin
  1. Grails Hibernate Plugin
  2. GPHIB-1

Add generate-hbm-xml script to expose hibernate config

    Details

    • Type: New Feature New Feature
    • Status: Reopened
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      It would be great to have a "grails generate-hbm-xml" command line option to output the hibernate XML files one could use to map all of the persistent classes in a grails app. It would be useful for understanding, troubleshooting, and tweaking how the grails default mapping is working.

        Activity

        Jon Gunnip created issue -
        Hide
        Tyler Williams added a comment -

        This would also be useful when another non-grails app needs to leverage a data model that was produced via GORM. Something we will run into in the near future. A similar option would be to dump the hbm files at runtime...maybe just in development.

        Show
        Tyler Williams added a comment - This would also be useful when another non-grails app needs to leverage a data model that was produced via GORM. Something we will run into in the near future. A similar option would be to dump the hbm files at runtime...maybe just in development.
        Graeme Rocher made changes -
        Field Original Value New Value
        Fix Version/s 1.2 [ 14155 ]
        Hide
        Michael Easter added a comment -

        The impact of this could be enormous. It could introduce a slew of Java/Hibernate people to the GORM.

        e.g. My current team is using Java and Hibernate3 with XML mappings. We find it expensive to recall how to map complicated structures, even with our own pre-existing work. I would love to fire up Grails/GORM where I could easily express relationships and then tweak the output. Essentially, the GORM would be a DSL to prototype mappings.

        Show
        Michael Easter added a comment - The impact of this could be enormous. It could introduce a slew of Java/Hibernate people to the GORM. e.g. My current team is using Java and Hibernate3 with XML mappings. We find it expensive to recall how to map complicated structures, even with our own pre-existing work. I would love to fire up Grails/GORM where I could easily express relationships and then tweak the output. Essentially, the GORM would be a DSL to prototype mappings.
        Hide
        Pam added a comment -

        This would also make it easier to use existing Hibernate tools for eclipse on a grails project. It needs to look at a configuration file in order to help you test out your criteria and queries. These tools really simplify complicated queries which findAllBy can't do... Thanks.

        Show
        Pam added a comment - This would also make it easier to use existing Hibernate tools for eclipse on a grails project. It needs to look at a configuration file in order to help you test out your criteria and queries. These tools really simplify complicated queries which findAllBy can't do... Thanks.
        Graeme Rocher made changes -
        Fix Version/s 1.2-M1 [ 14155 ]
        Fix Version/s 1.2-M2 [ 15425 ]
        Hide
        K Smith added a comment -

        this feature would have saved me countless hours of troubleshooting.

        in the end i gave up on hooking up GORM to a "legacy" (not really) schema and had to implement in hbm.xml. (i was trying to get a one-to-one with a shared primary key)

        switching to java/hbm has presented it's own problems as there is no way to access "transient fields" (getters/setters without a hbm mapping-- GrailsDomainClass only contains what is in the mapping, and seems to ignore the rest of the java class – i'm looking for this defect in jira now).

        Show
        K Smith added a comment - this feature would have saved me countless hours of troubleshooting. in the end i gave up on hooking up GORM to a "legacy" (not really) schema and had to implement in hbm.xml. (i was trying to get a one-to-one with a shared primary key) switching to java/hbm has presented it's own problems as there is no way to access "transient fields" (getters/setters without a hbm mapping-- GrailsDomainClass only contains what is in the mapping, and seems to ignore the rest of the java class – i'm looking for this defect in jira now).
        Graeme Rocher made changes -
        Fix Version/s 1.2-M2 [ 15425 ]
        Fix Version/s 1.2-M3 [ 15547 ]
        Graeme Rocher made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-M3 [ 15547 ]
        Fix Version/s 1.2-RC1 [ 15774 ]
        Graeme Rocher made changes -
        Fix Version/s 1.2-RC1 [ 15959 ]
        Fix Version/s 1.2-M4 [ 15774 ]
        Hide
        Graeme Rocher added a comment -

        There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3

        for 1.2 final only issues considered blocking will now be fixed

        Show
        Graeme Rocher added a comment - There is no scope / time to resolve these remaining lower priority issues for 1.2 so moving to 1.3 for 1.2 final only issues considered blocking will now be fixed
        Graeme Rocher made changes -
        Fix Version/s 1.2-RC1 [ 15959 ]
        Fix Version/s 1.3 [ 15400 ]
        Burt Beckwith made changes -
        Assignee Graeme Rocher [ graemerocher ] Burt Beckwith [ burtbeckwith ]
        Graeme Rocher made changes -
        Fix Version/s 1.3-RC1 [ 16274 ]
        Fix Version/s 1.3-M1 [ 15400 ]
        Graeme Rocher made changes -
        Fix Version/s 1.3-RC1 [ 16274 ]
        Show
        Burt Beckwith added a comment - Implemented by http://github.com/grails/grails-core/commit/673239d909514dc4e5bd578108f0e69cebcf07cf and docs are here: http://github.com/grails/grails-doc/commit/283b65dfc9ad69341e45070213b0330ea04f56c0
        Burt Beckwith made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 1.3.2 [ 16485 ]
        Resolution Fixed [ 1 ]
        Hide
        bmak added a comment -

        Unless I totally misread the 18/May/10 "solution", I would like to re-open this ticket and raise its priority. What was requested is a truely important feature. What was provided is more or less useless.

        Moreover, I absolutely fail to see how copying a template for the hibernate.cfg.xml file is anywhere close to a material equivalent to code generating the hbm files for each of the domain classes. Copying a template is not any solution at all. Just take a look at the original request and you will clearly understand that the request was for the hbm files. and over and over again, the comments were supportive of having the hbm files.

        Show
        bmak added a comment - Unless I totally misread the 18/May/10 "solution", I would like to re-open this ticket and raise its priority. What was requested is a truely important feature. What was provided is more or less useless. Moreover, I absolutely fail to see how copying a template for the hibernate.cfg.xml file is anywhere close to a material equivalent to code generating the hbm files for each of the domain classes. Copying a template is not any solution at all. Just take a look at the original request and you will clearly understand that the request was for the hbm files. and over and over again, the comments were supportive of having the hbm files.
        Hide
        Burt Beckwith added a comment - - edited

        Hmmm. I guess I joined hbm-xml and hibernate from the subject line and read it as wanting a script to generate a hibernate.cfg.xml file.

        The App Info plugin supports this as one of its features, although it's not available as a script - you need to manually make the request and copy/paste the generated hbm.xml to a file. See http://grails.org/plugin/app-info

        I'll reopen this and consider it for 1.4 or 2.0.

        Show
        Burt Beckwith added a comment - - edited Hmmm. I guess I joined hbm-xml and hibernate from the subject line and read it as wanting a script to generate a hibernate.cfg.xml file. The App Info plugin supports this as one of its features, although it's not available as a script - you need to manually make the request and copy/paste the generated hbm.xml to a file. See http://grails.org/plugin/app-info I'll reopen this and consider it for 1.4 or 2.0.
        Burt Beckwith made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Burt Beckwith made changes -
        Fix Version/s 2.0 [ 15421 ]
        Fix Version/s 1.3.2 [ 16485 ]
        Contegix Support made changes -
        Project Import Thu Mar 24 21:22:24 CDT 2011 [ 1301019744151 ]
        Burt Beckwith made changes -
        Workflow jira [ 31276 ] Grails [ 41614 ]
        Burt Beckwith made changes -
        Workflow Grails [ 41614 ] Copy of Grails [ 49065 ]
        Burt Beckwith made changes -
        Workflow Copy of Grails [ 49065 ] Grails [ 56475 ]
        Burt Beckwith made changes -
        Workflow Grails [ 56475 ] Grails2 [ 64034 ]
        Burt Beckwith made changes -
        Workflow Grails2 [ 64034 ] jira [ 76877 ]
        Burt Beckwith made changes -
        Workflow jira [ 76877 ] Grails2 [ 85421 ]
        Peter Ledbrook made changes -
        Last Reviewed 1/Jan/10 [ 2010-01-01 ]
        Peter Ledbrook made changes -
        Workflow Grails2 [ 85421 ] jira [ 93819 ]
        Peter Ledbrook made changes -
        Workflow jira [ 93819 ] Grails2 [ 101980 ]
        Jeff Scott Brown made changes -
        Project Grails [ 10020 ] Grails Hibernate Plugin [ 11295 ]
        Key GRAILS-2761 GPHIB-1
        Workflow Grails2 [ 101980 ] jira [ 106215 ]
        Last Reviewed 1/Jan/10 [ 2010-01-01 ]
        Fix Version/s 3.0 [ 11042 ]
        Component/s Persistence [ 10411 ]

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Jon Gunnip
          • Votes:
            17 Vote for this issue
            Watchers:
            18 Start watching this issue

            Dates

            • Created:
              Updated: