@DbForeignKey
@DbForeignKeyは、Ebeanによって生成される外部キーDDLを制御するために使用できます。
noConstraint = true
次の例では、外部キー制約が生成されないようにnoConstraint = trueが使用されています。
@ManyToOne
@DbForeignKey(noConstraint = true)
Customer customer;
onDelete/onUpdate ConstraintMode
onDeleteまたはonUpdateのConstraintModeを指定できます。
ConstraintModeは、RESTRICT、SET_NULL、SET_DEFAULT、CASCADEのいずれかになります。
@ManyToOne
@DbForeignKey(onDelete=ConstraintMode.CASCADE)
Address address;