Grails

cannot generate-all on a domain with nested enum (needs Groovy 1.7 nested class support)

Details

  • Type: Bug Bug
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.2-M4
  • Fix Version/s: None
  • Component/s: Scaffolding
  • Labels:
    None
  • Environment:
    1.2-M4

Description

grails generate-all com.test.ChatResource fails with the following domain class on 1.2M4:

package com.test

class ChatResource {

String name
String value
Type type

enum Type { SCRIPT, LINK; }
}

Activity

Hide
Graeme Rocher added a comment -

works for me. Note your domain should be:

class ChatResource {

	String name
	String value
	Type type

}
enum Type { SCRIPT, LINK; }
Show
Graeme Rocher added a comment - works for me. Note your domain should be:
class ChatResource {

	String name
	String value
	Type type

}
enum Type { SCRIPT, LINK; }
Hide
justin friedl added a comment -

Ok, so having the enum defined outside of the domain class works, but having it defined inside fails with:

"Domain class not found in grails-app/domain, trying hibernate mapped classes...
No domain class found for name com.test.ChatResource. Please try again and enter a valid domain class name"

This works in 1.1.1 so it still seems like a bug to me.

Show
justin friedl added a comment - Ok, so having the enum defined outside of the domain class works, but having it defined inside fails with: "Domain class not found in grails-app/domain, trying hibernate mapped classes... No domain class found for name com.test.ChatResource. Please try again and enter a valid domain class name" This works in 1.1.1 so it still seems like a bug to me.
Hide
Graeme Rocher added a comment -

It is probably pure luck that it worked as the construct you are using in the example is "nested" classes which Groovy hasn't supported and won't support until Groovy 1.7 (it is one of the main features of that release). Reducing priority to minor since workaround is available.

Show
Graeme Rocher added a comment - It is probably pure luck that it worked as the construct you are using in the example is "nested" classes which Groovy hasn't supported and won't support until Groovy 1.7 (it is one of the main features of that release). Reducing priority to minor since workaround is available.
Hide
Graeme Rocher added a comment -

Grails 1.3 will support Groovy 1.7 which will support this feature (nesting classes). See http://jira.codehaus.org/browse/GROOVY-3080 for reference

Show
Graeme Rocher added a comment - Grails 1.3 will support Groovy 1.7 which will support this feature (nesting classes). See http://jira.codehaus.org/browse/GROOVY-3080 for reference

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Last Reviewed: