Код: Выделить всё
@Entity(name = "LogbookEntry")
public class LogbookEntryView {
@ElementCollection(fetch = FetchType.EAGER)
@AttributeOverride(name = "start", column = @Column(name = "tachReading_start"))
@AttributeOverride(name = "end", column = @Column(name = "tachReading_end"))
List tachReading;
// ... other attributes
}
< /code>
Объект встроен: < /p>
@Embeddable
public class MeterReading {
@NotNull
Duration start;
@NotNull
Duration end;
}
Однако, когда LogbookEntryView . Аннотирован с @ondelete (action = ondeleteAction.cascade) ), я получаю эту ошибку:
Код: Выделить всё
Cannot delete or update a parent row: a foreign key constraint fails (`zero-eight`.`logbook_entry_tach_reading`, CONSTRAINT `FKm3fndbcqjghofus5l3sa1xfse` FOREIGN KEY (`logbook_entry_id_uuid`) REFERENCES `logbook_entry` (`id_uuid`))
Подробнее здесь: https://stackoverflow.com/questions/797 ... n-hibernat