Grails Scaffolding Plugin
  1. Grails Scaffolding Plugin
  2. GPSCAFFOLD-73

generate-all should look for domain class in package by convention

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      Running 'grails generate-all SomeDomainClass' leads to the following error:

      No domain class found for name SomeDomainClass

      This is due to SomeDomainClass residing in the default package (the app name), so the following works:

      grails generate-all appName.SomeDomainClass

      generate-all should look for the domain class in the default package by convention, so I can write 'grails generate-all SomeDomainClass' as an alias to 'grails generate-all appName.SomeDomainClass'

        Activity

        Hide
        Björn Wilmsmann added a comment -
        Show
        Björn Wilmsmann added a comment - Related to https://jira.codehaus.org/browse/GRAILS-5713
        Hide
        Björn Wilmsmann added a comment -

        This applies to the other 'generate' scripts, too.

        Show
        Björn Wilmsmann added a comment - This applies to the other 'generate' scripts, too.
        Hide
        Nicholas Vaidyanathan added a comment -

        No it shouldn't. You shouldn't be using the default package. It's poor software development practice for a multitude of reasons like http://marceloverdijk.blogspot.com/2009/03/grails-tip-of-day-always-use-packages.html, and has been well known bad practice in the Java world for years. http://www.coderanch.com/t/512937/java/java/default-package-discouraged-Should-worry

        Don't do this.

        Show
        Nicholas Vaidyanathan added a comment - No it shouldn't. You shouldn't be using the default package. It's poor software development practice for a multitude of reasons like http://marceloverdijk.blogspot.com/2009/03/grails-tip-of-day-always-use-packages.html , and has been well known bad practice in the Java world for years. http://www.coderanch.com/t/512937/java/java/default-package-discouraged-Should-worry Don't do this.
        Hide
        Nicholas Vaidyanathan added a comment -

        ...To be fair, this isn't exactly the default package. I didn't realize that Grails is now creating the app name package to keep things out of the default...personally, I'm not sure I like that. It's a nice convenience for programmers migrating from other languages, but it does break the Java packaging convention around domain names. Good idea?

        Show
        Nicholas Vaidyanathan added a comment - ...To be fair, this isn't exactly the default package. I didn't realize that Grails is now creating the app name package to keep things out of the default...personally, I'm not sure I like that. It's a nice convenience for programmers migrating from other languages, but it does break the Java packaging convention around domain names. Good idea?

          People

          • Assignee:
            Unassigned
            Reporter:
            Björn Wilmsmann
          • Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: