Hi all,
I have Car hibernate object bound to cars table; each car has its speedometer readings (List of date and speedometer value) bound to "speedometers" table,
When removing speedometer value from the car speedometer list and persisting the Car - speedometer is not deleted from the DB (save is working ok)
What am I doing wrong?
Thank you very much for your help!
CarSpeedometer object:Code:
@ManyToOne
@NotNull
@JoinColumn(name="car_plate")
private Car car;
Car object:
Code:
@OneToMany(mappedBy="car",cascade={CascadeType.ALL})
@LazyCollection(LazyCollectionOption.FALSE)
@JoinColumn (name = "car_plate")
@org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@OrderBy("speedometerDate")
private List<CarSpeedometer> speedometers = new ArrayList<CarSpeedometer>();