i'm using hibernate annotations in my project, I've created the tables and it's all good except that when i check the database their's no cascade even tho I've made sure to put it in the classes. here is an exemple of how i do it :
public class Item implements java.io.Serializable {
/**
*
*/
private static final long serialVersionUID = 8271695210797279161L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "IDitem", unique = true, nullable = false)
private int iditem;
@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "IDDIVISION", nullable = false)
private Division division;
@Column(name = "SIGLE", length = 254)
private String sigleItem;
@Column(name = "DESCRIPTION", length = 254)
private String description;
....
}
i have cascade = CascadeType.ALL in all the ManyToOne, OneToMany and ManyToMany cases. i tried also to add
@OnDelete(action = OnDeleteAction.CASCADE)
@Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
like mentioned here but nothing changed
can you help me solve the problem? thank you!