Automatic instantiation of embedded instances

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Automatic instantiation of embedded instances

Jacob Severson
Hi All,

I did some searching and couldn't find anything on this, so I apologize if I missed a conversation about this somewhere.

I'm defining a relationship of collections of other domain instances and trying to embed them such as:

List<City> cities
static embedded = ['cities']

When grails tries to bind data to an embedded field, GrailsDataBinder.autoInstantiateEmbeddedInstance(Class<?> type) tries to get a new instance of the field's class without checking if the type is instantiable.

I'm wondering if this is by design and I'm missing something or if this is something that should be fixed?

Thanks,
Jacob