|
When I have a custom type in a Map relation it thows an exception.
exception: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:514) at org.hibernate.cfg.annotations.SimpleValueBinder.fillSimpleValue(SimpleValueBinder.java:516) at org.hibernate.cfg.annotations.SimpleValueBinder.make(SimpleValueBinder.java:414) at org.hibernate.cfg.annotations.MapBinder.bindKeyFromAssociationTable(MapBinder.java:305) at org.hibernate.cfg.annotations.MapBinder.access$000(MapBinder.java:76) at org.hibernate.cfg.annotations.MapBinder$1.secondPass(MapBinder.java:111) at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:70) at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697) at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1426) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1373) at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.afterConstructAndConfigureConfiguration(BaseCoreFunctionalTestCase.java:162) at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.buildSessionFactory(BaseCoreFunctionalTestCase.java:126) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.hibernate.testing.junit4.TestClassMetadata.performCallbackInvocation(TestClassMetadata.java:205) ... 15 more
e.g. mapping: @ElementCollection @MapKeyType(@Type(type = "org.hibernate.test.annotations.enumerated.custom_types.FirstLetterType")) Map<FirstLetter, String> firstLetterMap = new HashMap<FirstLetter, String>();
|