Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2.0.GA
Mapping documents:
@OneToMany
@Sort(type=SortType.NATURAL)
@Cascade(value=CascadeType.ALL)
@MapKey(columns=@Column(name="year"))
@JoinColumn
public SortedMap<Integer, String> getValues() {
return this.valueMap;
}
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
java.lang.NullPointerException
at org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:112)
at org.hibernate.cfg.annotations.MapBinder.access$000(MapBinder.java:51)
at org.hibernate.cfg.annotations.MapBinder$1.secondPass(MapBinder.java:81)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1127)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283)
at com.queo.lifecycle.util.HibernateUtil.<clinit>(HibernateUtil.java:23)
java.lang.ExceptionInInitializerError
Name and version of the database you are using:
Mysql 5.0.26
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
When using a normal Map without Sorting everything works as expected.
With a SortedMap i get the above stacktrace when building the sessionfactory. Am i doing something wrong or is this a bug?
Thanks in advance Tom