Hello All,
Ran into a strange problem (not really sure what is wrong) when I tried to
extend a working Entity Bean. The extended Entity Bean complains about a
collection in its parent class.
Here is the error message:
| org.hibernate.AnnotationException: Collection of elements must not have
mappedBy or association reference an unmapped entity: TrackedItem.userData
Here is TrackedItem:
@Entity
| @Inheritance(strategy=InheritanceType.JOINED)
| @DiscriminatorValue(value = "I")
| public class TrackedItem implements Serializable
| {
| ....
| @OneToMany(mappedBy="item", cascade = {CascadeType.ALL})
| @MapKey(name="key")
| private Map<String, UserDatum> userData;
| }
Here is UserDatum:
@Entity
| public class UserDatum implements Serializable {
| ...
| private String key;
| @ManyToOne
| private TrackedItem item;
| }
|
Here is Fail which extends TrackedItem:
@Entity
| @DiscriminatorValue(value = "S")
| public class Fail extends TrackedItem {
| ....
| }
Fail doesn't contain any collections or references to userData or UserDatum.
When I deploy TrackedItem and UserDatum everything deploys cleanly, works fine
and my unit tests pass. When deploy Fail, I get the error message above as the
reason the deployment failed.
Any help is appreciated!
Sincerely,
Stephen
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940749#3940749
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3940749
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user