Which part of grails actually creates new tables from domain classes?
My app has suddenly stopped creating tables from new domain classes?! Only thing I can thing of that has changed in my environment is that I have installed and then uninstalled the taxonomy plugin?
Without an explicit import, the default import of groovy.lang.* is taking precendence and groovy.lang.Category is used, not your class.
On Monday, February 20, 2012 10:46:31 AM webmediauk wrote:
> The plot thickens!
> I've renamed my domain class and used grails console to manipulate it.
> So my domain class is called Category. When I start grails console no
> database table is created. When I then do something like:
> new co.uk.tpg.Category( title: 'Cars' ).save( flush: true )
> The table is created and my object saved! but if I put something like this
> into my Bootstrap:
> def categories = Category.list()
> new Category( title: "Finance" ).save( flush: true )
> I get an error:
> Error executing bootstraps: groovy.lang.MissingMethodException: No signature
> of method: co.uk.tpg.Category.save() is applicable for argument types:
> (java.util.LinkedHashMap) values: [[flush:true]]
> It's really weird because I have tonnes of other domain objects that I
> create in the Bootstrap and they all get created fine apart from this
> Any ideas?
> View this message in context: http://grails.1312388.n4.nabble.com/Grails-has-stopped-creating-new-tables-tp4403711p4404784.html
To unsubscribe from this list, please visit:
Thanks for the reply,
This is just in my test environment so I have dropped and recreated the whole database several times.
Everything is setup properly in the datasource and I dont have any issues with my other domain classes, it just seems like this particular domain class is not available in the app but is available in console???
FYI: I solved this issue by backing up my grails app and completely reinstalling Netbeans!
Then manually copying the domain classes and controllers etc in a new grails app.
Must have been IDE related.
Thanks for your help anyway.