Entity Car - Das Entity Car wird um das Attribut logbook vom Typ Logbook erweitert.
@OneToOne(mappedBy = "car") public Logbook getLogbook() { return logbook; } public void setLogbook(Logbook logbook) { this.logbook = logbook; } |
Entity Logbook - Das Entity Logbook wird um das Attribut car vom Typ Car erweitert.
@OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "car_id") public Car getCar() { return car; } public void setCar(Car car) { this.car = car; } |