]
Steve Ebersole commented on HHH-5385:
-------------------------------------
How is this any different from and more beneficial then the application simply writing a
custom marshaller to "serialize" the graph?
Make Hibernate wrapped objects more serializable friendly
---------------------------------------------------------
Key: HHH-5385
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5385
Project: Hibernate Core
Issue Type: New Feature
Reporter: Bill DeCoste
Make Hibernate wrapped objects more serializable friendly.
LazyInitializationException's are the devil when trying to serialize an object graph.
A mechanism for being able to serialize an uninitialized collection or object that returns
null or an empty set is highly preferable to the existing behavior that currently causes
the infamous LazyInitializationException explosion.
- Use case: We'd like to abridge certain object graphs when serializing
objects for representation. For instance, I might want to get all Avatar names, but not
the entire object graph of every avatar in the system. We currently have a mechanism that
accomplishes this, but at substantial cost due to the fact that we must purposefully fetch
the entire object, then hack away what we don't want to send. We'd rather leave
sub-collections, etc., uninitialized/unfetched and be able to serialize without error.
Another way to express it is that we'd like the option to ignore and skip
uninitialized collections (leaving them null/empty) when serializing an object.
- Related issue: We currently have some code to work around a perceived issue
where an empty collection always returns a LazyInitializationException if left in the
object graph. We have found that we have to explicitly null-out empty collections in an
object before serialization. We'd like to not have to worry about this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: