-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: serialize domain objects to a hashmap
PostPosted: Wed Jun 23, 2010 10:14 am 
Newbie

Joined: Wed Jun 23, 2010 10:08 am
Posts: 1
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 in Spring uses this format to rebuild an object graph.... e.g. mapping a http request to domain objects...

TIA


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.