hibernate cascade of meaning

/ ** 
     * (Optional The) Operations of The Cascaded to that MUST BE 
* The target of The Association. (Optional) must be concatenated to the operation target of the association. * * <P> By default NO Operations are Cascaded default, no cascading.
* / Of CascadeType [] Cascade () default {};

Translates to "(optional) must be cascaded to the operating target of the association, by default no cascading." A is an entity changes, associated entities B should be updated

The east and west can be chaotic configuration, otherwise it will go wrong, for example in the way of many to one relationship, if you configure a cascade in many square = "save-update, persist", when we break the relationship, the main object is updated foreign key (and pass over from the object only the primary key has value), will result in a cache from an object other than the main key other values ​​are empty, then there will be a program not being given, the database from the data in the table out of the primary key empty problem.

Guess you like

Origin www.cnblogs.com/Sly-Mi/p/11203674.html