Auf Thema antworten

Hallo,


Das hab ich versucht, hat aber nicht geklappt bzw. ist ohne Auswirkung, Ich hab 2 Tabellen in der DB (TParticipant und TContact) welche beide nur Primary keys haben und diese möchte ich verbinden, Ich habe also keine Foreign- key Spalte in TParticipant.



[code=Java]

@OneToOne(optional=true)

  @PrimaryKeyJoinColumn

  public Contact getContact() {

    return contact;

    }

[/code]


Also wirds da wohl keine Möglichkeit geben, dass ich ohne einer FK Splate auskomme in Addresse/TParticipant schätz ich mal, da der Primary key in Addresse/Participant nicht null sein kann und deshalb auch das obere "optional=true" umsonst ist?

Lieg ich da richtig?



Oben