-->
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.  [ 2 posts ] 
Author Message
 Post subject: map-key many-to-one property via hbm xml mappings
PostPosted: Fri Jun 10, 2016 1:28 pm 
Newbie

Joined: Wed Apr 27, 2016 2:45 pm
Posts: 6
I have a map in which I want the key to be a property of the object in the value. This can be done with annotation mappings i believe using the @MapKey annotation. I'm also not clear if that has to be a simple property? The property i'm interested in is a many-to-one assocation. Finally I wish to do this using xml mappings, because i have to use them. Thoughts? It seems the map-key element only supports adding a simple column to the map table.. as opposed to using a property of the map value.


Top
 Profile  
 
 Post subject: Re: map-key many-to-one property via hbm xml mappings
PostPosted: Fri Jun 10, 2016 2:04 pm 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
Try the following mapping


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.