Skip to content

GPMONGODB-21: Embedded class defined in same file as parent results in NPE when saving parent object #216

@graemerocher

Description

@graemerocher

Original Reporter: ceracm
Environment: Not Specified
Version: Not Specified
Migrated From: http://jira.grails.org/browse/GPMONGODB-21

{code}
java.lang.NullPointerException
at org.grails.datastore.gorm.GormInstanceApi.save(GormInstanceApi.groovy:139)
at org.grails.datastore.gorm.GormEnhancer$1.call(GormEnhancer.groovy:93)
at demo1.CustomerController$_closure4.doCall(CustomerController.groovy:24)
at demo1.CustomerController$_closure4.doCall(CustomerController.groovy)
at java.lang.Thread.run(Thread.java:680)
{code}

Customer.groovy:

{code}
class Customer {
String name
Address address
static embedded = ['address']
}

class Address {
String street
}
{code}


Moving Address to its own file fixes the problem.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions