开发者

grails generate-all behaving strangely / erroneously (1.3.7)

开发者 https://www.devze.com 2023-04-11 12:11 出处:网络
I created a domain class called Money, with 3 fields.I did a generate-all. Then I totally changed the class, it now has a total of 10 fields, with none the same names as the first 3 fields.

I created a domain class called Money, with 3 fields. I did a generate-all.

Then I totally changed the class, it now has a total of 10 fields, with none the same names as the first 3 fields.

When I generate-all, two problematic things are happening:

1) it is generating the old Money domain class, only containing the 3 fields, as observed by opening create.gsp or by running the code.

2) the overwrite behavior also has a small bug: I blow away the views/money directory and the MoneyController, and I find what happens is, the generate-all first generates the old domain class views/controller (i.e. from step 1), by observing the immediate/new file date/timestamps, and then asks me if I want to overwrite them! :-) Overwrite the stuff it just generated.

I've done this several times -- blow away the views/money directory, the MoneyController, but I can't get it to recognize the new one domain class, and have it build that. Strange.

I'm doing this in Intellig, using either the grails command window, or the short-cuts it allows one to do from the domain class; both operate the same (problem).

So I must have some Money domain class stuck somewhere, but I'll be darned if I can find开发者_JAVA百科 it. Also, note I do have the correct package in my new version of the domain class.

Any Suggestions?

I'm going to do a rename this class to Money2, just so I can get it to work. But that's probably not a good end solution! :-(

I've also exited out of intellij, and that didn't help.


This appears to be a problem in Intellij. When I ran grails generate-all outside of Intellij, it found errors in my constraints, and would not build the GSPs.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号