我对禁用 JoinTable 的删除有问题。
@Entity
class Employee
{
@Id
Long id;
@ManyToOne( cascade = { CascadeType.REFRESH } )
@JoinTable( name = "Employee2AddressOracleView",
joinColumns = @JoinColumn( name = "employee_id" ),
inverseJoinColumns = @JoinColumn( name = "address_id" )
private Address address;
)
员工的地址在视图中计算。它有效,我可以加载员工,但是当我想删除员工时,JPA 想从视图中删除行。可以禁用此删除查询吗?
控制台中的 JPA 查询:
delete from Employee where employee_id = ?
delete from Employee2AddressOracleView where employee_id = ?