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