-
Jun 22nd, 2010, 03:02 PM
#1
serialize domain objects to a hashmap
Given the following object graph, where Author has 1 to many Books...
Author {
String name
Set Books
}
Book {
String title
}
Is there an out of the box way to serialize this object graph to a HashMap
e.g. key is a bean property name and value is the actual value
e.g.
[name="Joe", book[0].title="book 1", book[1].title="book 2"]
Is there recommended approach to this?
I know I can get to the hibernate metadata and iterate through properties etc etc. But I was hoping there would be a helper class for this. Since the databinding stuff uses this format to rebuild an object graph.... e.g. mapping a http request to domain objects...
TIA,
Martin
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules