The following schema runs fine (using hibernate-entitymanager 4.0.1.Final):
@Entity // I left off the getters, setters, etc. class MyEntity{ @ElementCollection Collection<MyEmbeddable> myEmbeddables; } @Embeddable class MyEmbeddable{ Integer value; }
But when I nest an embeddable within MyEmbeddable, I run into trouble.
@Entity class MyEntity{ @ElementCollection Collection<MyEmbeddable> myEmbeddables; } @Embeddable class MyEmbeddable{ MyNestedEmbeddable myNestedEmbeddable; } @Embeddable class MyNestedEmbeddable{ Integer value; }
Before Hibernate creates any database tables, I get the following error:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1727) at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1706) at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:602) at org.hibernate.persister.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:73) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:226) ... 50 more
Thanks in advance for any help.
|