-->
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.  [ 5 posts ] 
Author Message
 Post subject: Is it possible to persist a Map where the key is a UserType?
PostPosted: Mon Nov 13, 2006 1:46 pm 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
Is it possible to define a UserType for the key in a Map?

Something like this?

@CollectionOfElements
@Type(type = "com.example.CustomDateType)
@MapKey(columns = { @Column(name = "key_value", nullable = false) })
public Map<CustomDate, Double> getDateThresholds()
{
return dateThresholds;
}


This syntax causes the CustomDate to be serialised into the key_value column rather than being converted using the UserType.

Any help would be greatly appreciated.

Thanks.
Ashley


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 13, 2006 6:58 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
there is an open JIRA issue If I recall

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 8:37 am 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
Thanks for the info.

We've managed to work around it by creating a new holder class called DateThreshold and using the javax.persistence.MapKey annotation to create a map of DateThreshold.customDate and DateThreshold.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 10:28 am 
Newbie

Joined: Mon Jan 12, 2004 5:46 pm
Posts: 8
emmanuel wrote:
there is an open JIRA issue If I recall


Do you know, by any chance, what is its JIRA id ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 14, 2006 11:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
nope

_________________
Emmanuel


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