java - jpa OneToOne relations with more than one table -


i have these 2 tables onetoone relation :

@entity @table(name = "event") public class event implements serializable {  @id private string id;  @joincolumn(name = "id") @onetoone @mapsid public outgoingeventrequest outgoingeventrequest;  }  @entity @table(name = "outgoing_event_request") public class outgoingeventrequest implements serializable {  @id @generatedvalue(generator = "system-uuid") @genericgenerator(name = "system-uuid", strategy = "uuid") private string id;  @onetoone(cascade = cascadetype.all, mappedby = "outgoingeventrequest") private event event;  } 

this works fine , want add onetoone table event, event have onetoone relations 2 (and maybe later – more) tables , , every time use id of relavent table , recored of outgoing_event_request table , have id of table , on .. how can ?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -