且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Hibernate中CascadeType的默认值

更新时间:2023-01-30 10:18:44

CascadeType 默认为空数组。请参阅注释类型OneToOne中的CascadeType


默认情况下,没有操作级联。



I am using Hibernate to persist this bean.

import javax.persistence.*;

@Entity
public class Person {
    @Id @GeneratedValue
    private int id;
    @Column
    private String name;
    @OneToOne
    private Address addr;
}

What is the CascadeType for addr?

CascadeType defaults to the empty array . See CascadeType in Annotation Type OneToOne

By default no operations are cascaded.