Entity Car - The Car entity is enhanced by the logbook attribute of type Logbook.
@OneToOne(mappedBy = "car") public Logbook getLogbook() { return logbook; } public void setLogbook(Logbook logbook) { this.logbook = logbook; } |
Entity Logbook - The Logbook entity is enhanced by the car attribute of type Car.
@OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "car_id") public Car getCar() { return car; } public void setCar(Car car) { this.car = car; } |