Entity Car - Das Entity Car wird um das Attribut logbook vom Typ Logbook erweitert.
@OneToOne(mappedBy = "car") public Logbook getLogbook() { return this.logbook; } public void setLogbook(final 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 this.car; } public void setCar(final Car car) { this.car = car; } |