-->
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: JPA unidirectional @OneToMany without join table
PostPosted: Sun Apr 25, 2010 6:50 pm 
Newbie

Joined: Sun Apr 25, 2010 6:04 pm
Posts: 1
Hi,
I've got a very simple JPA unidirectional @OneToMany mapping and I'm getting an error. One CD has many Tracks, the CD owns the relationship:

Code:
@Entity
public class CD {
...
    @OneToMany(cascade = CascadeType.ALL, orphanRemoval=true)
    @JoinColumn(table="track", name="cd")
    private List<Track> tracks


org.hibernate.cfg.NotYetImplementedException: Collections having FK in secondary table
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1562)

This happens whenever I use the @JoinColumn annotation (with or without the table attribute). Without the @JoinColumn annotation, it generates and uses a join table, which is not what I want for a OneToMany.

Hibernate 3.3.2.GA.

Surely simple OneToMany mappings like this are implemented, or have I got the annotation wrong in some way? This was reported previously but apparently not resolved:
viewtopic.php?p=2367398
Note the bug seems to be in processing the annotation, not in generating/executing DDL, and occurs even if the schema has been created manually. The only bug I have found like this is
http://opensource.atlassian.com/project ... e/HHH-5091
but that is apparently a later version.


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.