-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: trouble with nested embeddable in ElementCollection
PostPosted: Mon Jan 23, 2012 11:17 pm 
Newbie

Joined: Mon Jan 23, 2012 10:47 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.