Hi experts, I’m trying to use Hibernate 3.5.3 to persist my Classes of my project. All concrete classes have related tables into my database (they are entities), they were mapped using Annotations and Hibernate recognizes them. But my problem is into “main class” GeneralUser: @Entity @Table(name = "F_AEXA_MEMBERS") publicclass GeneralUser implements Serializable { /** * */ privatestaticfinallongserialVersionUID = 4234518752392079435L; @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinColumn(name="F_AEXA_MEMBERS_CPF") private Collection<RoleHomePage> roleHomePage; //MY ISSUE IS HERE! @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY) @JoinColumn(name="F_AEXA_MEMBERS_CPF") private Collection<IUserProfile> userProfile; Other fields declaration so on were omitted. What is happening: line above is an attribute where in real time I’ll “load” with my other objects based on concrete classes (my entities. Eg. AEXAFriend, NotFEGEmployee, etc.) – I’m using Design Pattern Strategy. My concrete entities AEXAFriend, NotFEGEmployee, etc., they implement the interface IUserProfile, so I'm trying to load the object userProfile with classes which implement this interface.
But when I test my program I face the message: Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: applicationLayers.domain.users.GeneralUser.userProfile[applicationLayers.domain.users.IUserProfile] Ok, I believe the problem here is the annotation for interface. If I use @Transient before line above in my code, my object to be loaded into won’t be considered into hibernate and we’ll have inconsistence into database. Please, is anyone has any experience with this case? Regards, Marcelo Cabrera
_________________ Marcelo Cabrera
|