-->
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.  [ 3 posts ] 
Author Message
 Post subject: Is there *any* way at all to persist java.util.Maps?
PostPosted: Wed Jan 25, 2006 3:02 pm 
Newbie

Joined: Sat Jan 07, 2006 10:33 am
Posts: 18
Location: New York NY
I hope the question is clear enough. I have been struggling with this for days. It appears to me that there is absolutely no way, using current Hibernate Annotations 3.1beta8, to persist any java.util.Map in which the values are entities.

I just want to know whether I am correct. I understand that this is clearly labeled "beta", I know that there is an issue in JIRA that says "Support Map". The reason I keep trying to figure out how to do it is that people have alluded to possible workarounds. But I can't see what they are. I understand now that I cannot use @CollectionOfElements. I see in JIRA that @MapKey is not supposed to work with @ManyToMany, but when I try to omit @MapKey, I get a complaint at runtime.

So it seems like there is just absolutely no way to use H Annotations on a class that has Map members whose values are not embeddable objects. Is this true? Or can someone please enlighten me as to a possible workaround?

Many thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 4:54 am 
Beginner
Beginner

Joined: Wed Aug 24, 2005 5:32 am
Posts: 23
Hi,
I have an entry on my blog about maps persistence. mybe it would help you
http://jroller.com/page/eyallupu?entry=using_annotations_to_persist_java


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 7:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There are examples in the unit test suite. 95% of example are meant to be human readable.

Nice blog eyall, I've linked it from the FAQ

_________________
Emmanuel


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

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.