It's not null, that's just the default output of the toString
method that Grails adds. It prints the class name and the id. Since you haven't saved the instance, the id is null. If the instance was null the output would have been null
, not scheduler.Client : null
If you want to see the data in the instance, use the Groovy dump()
method, e.g.
def client = new Client(name:"John")
println client.dump()
You could also add a toString
method that includes the name
attribute, e.g.
package scheduler
class Client {
String name
String toString() { name }
}