I try to get a fairly simple mapping for a TreeMap to work:
Code:
@org.hibernate.annotations.CollectionOfElements
@JoinTable(
name = "cbs_hour_quotes",
joinColumns = {@JoinColumn(name = "cbs_id")}
)
@MapKey(name = "year")
@Column(name = "quote")
@org.hibernate.annotations.Sort(type = org.hibernate.annotations.SortType.NATURAL)
private SortedMap<Integer, Double> quotes;
I expext as result a table named cbs_hour_quotes with 3 colums cbs_id, year and quote.
Instead i get the following exception:
Code:
Caused by: org.hibernate.AnnotationException: Associated class not found: java.lang.Double
at org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:100)
at org.hibernate.cfg.annotations.MapBinder.access$000(MapBinder.java:53)
at org.hibernate.cfg.annotations.MapBinder$1.secondPass(MapBinder.java:83)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:316)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at it.atsf.draft.persistence.HibernateUtil.<clinit>(HibernateUtil.java:17)
... 32 more
Any idea what's wrong? Why is it not possible to map a basic Double type?
Environment:
JDK 1.6
Hibernate 3.2.4.ga
Annotations 3.3.0.ga