When you map a component to a class, the mapped component returns null when the component's mapped columns are empty. Here's how the Hibernate documentation explains this:
"When reloading the containing object, Hibernate will assume that if all component columns are null, then the entire component is null. This should be okay for most purposes. "
This is fine in some instances but not when you try to populate or retrieve data from your containing object through a beanwrapper. This is often done in web frameworks such as Spring.
I believe you should have the option to retrieve a non-null component even if the component columns are empty.
|