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;
}