I know I can create a class using: grails create-domain-class book
This will create a class file in my project that I can then access via the console.
My question is 'how can I create a use a class in the console itself that I can then save()?'
If I type the following in the console I get an error:
class Tree {
String name
Date dateCreated
}
def tree = new Tree(name:'oak').save()
The error I get is:
Exception thrown
groovy.lang.MissingMethodException: No signature of method:
Tree.save() is applicable for argument types: () values: []
Possible solutions: wait(), any(), wait(long), each(groovy.lang.Closure),
sleep(long), use([Ljava.lang.Object;)
at ConsoleScript6.run(ConsoleScript6:6)