-->
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: UserType for value-only of a java.util.Map
PostPosted: Wed Oct 29, 2008 2:58 pm 
Newbie

Joined: Mon Jul 05, 2004 5:20 pm
Posts: 11
Is there any way to specify a UserType ONLY for the Value of a map? (and not the key).
The pasted example configuration makes hibernate use the same UserType for both the key and the value.

The abstract collection persister doeS:
Code:
if ( hasIndex /*&& !indexIsFormula*/ ) {
                           loc = writeIndex( st, collection.getIndex(entry, i, this), loc, session );
                        }
                        loc = writeElement(st, collection.getElement(entry), loc, session );


and then in the writeIndex method:
Code:
getIndexType()


which returns the same UserType for both the key and the value (since it is the same AbstractCollectionPersister instance. I don't have any way to know if I am nullSafeGet/Set'ing the key or the value.


Any help is appreciated!
Thanks
AB

Hibernate version: 3.3ga

Mapping documents:
@org.hibernate.annotations.CollectionOfElements
@JoinTable(name="MSG_TEMPLATE_VALUES",
joinColumns=@JoinColumn(name="MSG_DATA_ID"))
@org.hibernate.annotations.MapKey(columns = @Column(name="MTV_KEY"))
@Column(name="MTV_VALUE")
@Type(type="ClobString")
public Map<String, String> getData() {
return data;
}


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.