-->
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: JoinTable with wrong PK
PostPosted: Sat Jun 09, 2007 8:38 am 
Newbie

Joined: Sat Jun 09, 2007 8:24 am
Posts: 1
Location: germany, rosenheim, BY
hi,
I have following annotations in my code:

Code:
    @Entity
@Table(name = "TOURPOSITION")

public class TourPosition implements Serializable {
......
    @ManyToOne
    @JoinTable(name = "TPOS_TOURKOPF_TKO",
        joinColumns = @JoinColumn(name = "TPOS_UID") ,
        inverseJoinColumns = @JoinColumn(name = "TKO_UID"))
    private TourKopf tourKopf = null;

    @OneToOne
    @JoinColumn(name = "TPOS_GPSZIELAUFTRAG_GZA_UID",
        nullable = false)
    private GPSZielAuftrag gPSZielAuftrag = null;


and this was generated from hibernate:
Code:
   create table TOURPOSITION (
        TPOS_UID bigint not null,
        TPOS_VERSION integer,
....
        TPOS_GPSZIELAUFTRAG_GZA_UID bigint not null,
        TPOS_LIEFERART_LART_UID bigint not null,
        primary key (TPOS_UID)
    );

    create table TPOS_TOURKOPF_TKO (
        TPOS_UID bigint not null,
        TKO_UID bigint,
        primary key (TPOS_GPSZIELAUFTRAG_GZA_UID)
    );


I dont understand why hibernate is generating this PK

my relationships are:
TOURKOPF 1<-->*TOURPOS1<-->1GPSZIELAUFTRAG

thx for any help

ekkehard


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.