-->
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: @MappedSuperClass and @AssociationOverride bug?
PostPosted: Mon Jun 12, 2006 5:56 am 
Newbie

Joined: Mon Jun 12, 2006 5:26 am
Posts: 3
I have the following hierarchy:
Code:
@Entity
@Table(name = "TANNANN")
@Inheritance(strategy = InheritanceType.JOINED)
public class Advice {
...
}

@MappedSuperclass
public class RLAdvice extends Advice {

    private Counterparty clearer;
   @OneToOne(optional = false, fetch = FetchType.LAZY)
    @JoinColumn(name = "")
    public Counterparty getClearer() {
        return clearer;
    }
...
}

@Entity
@Table(name = "TSNPANN")
@PrimaryKeyJoinColumn(name = "IDXANN")
@AttributeOverrides(...)
@AssociationOverrides({
    @AssociationOverride(name = "clearer", joinColumns = @JoinColumn(name = "CLEARER")),
...
})
public class SnpAdvice extends RLAdvice {
...
}


If I remove the line
Code:
@JoinColumn(name = "")
on the super class RLAdvice, I got the following exception:

Code:
org.hibernate.AnnotationException: Illegal attempt to define a @JoinColumn with a mappedBy association: clearer
   at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:152)
   at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumns(Ejb3JoinColumn.java:127)
   at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1094)
   at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:699)
   at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:353)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:265)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205)


Am I missing something or is it a bug ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 07, 2007 11:52 am 
Beginner
Beginner

Joined: Tue Jan 18, 2005 9:37 am
Posts: 29
Location: The Netherlands
Thanks for the post. I had the same problem.


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.