-->
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.  [ 2 posts ] 
Author Message
 Post subject: @IdClass and interfaces
PostPosted: Mon Oct 01, 2007 7:22 am 
Newbie

Joined: Mon Oct 01, 2007 6:56 am
Posts: 6
Hi there,

I have a class with a composite key mapped through @IdClass, where both foreign keys are declared through their interfaces. The interfaces have a default "*Impl" implementations and are also mapped through annotations. Now if I try to load the mappings, hibernate complains about an unknown type, since the foreign key is declared using an interface :(

Btw, the mappings are unidirectional.

Code:
@Entity
@Table(name="submission_result")
@IdClass(SubmissionResultPk.class)
public class SubmissionResultBean
implements SubmissionResult
{

    @Id
    private BaseArticle article;
    @Id
    private Magazine magazine;
    ...
}

@Embeddable
public class SubmissionResultPk
implements Serializable
{
    private BaseArticle article;
    private Magazine magazine;
   
    // getters/setters
}


Now the question is, is there a way to tell hibernate, that article and magazine properties are already mapped in BaseArticleImpl and MagazineImpl classes (like it's done in @*To*(targetEntity=...) annotations)?

TIA,
jenner


Top
 Profile  
 
 Post subject: solved
PostPosted: Mon Oct 01, 2007 11:19 am 
Newbie

Joined: Mon Oct 01, 2007 6:56 am
Posts: 6
@Target(...) solved it.

Cheers,
jenner


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

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.