-->
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: Issue with interface - Design Pattern Strategy
PostPosted: Mon Sep 27, 2010 12:20 am 
Newbie

Joined: Mon Sep 27, 2010 12:07 am
Posts: 1
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


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.