Saturday, May 19, 2012

Cascade type - EJB 3.0


Cascade type - EJB 3.0:

The cascade type specifies the set of operations that can be cascaded to a related entity. CascadeType can have different values: PERSIST, MERGE, REMOVE, REFRESH, and ALL.
PERSIST is similar to an insert command. Specifying a CascadeType of PERSIST implies that a persist operation will be cascaded from a parent entity to its child entity.

MERGE is similar to an update command. Specifying a CascadeType of MERGE implies that a merge operation will be cascaded from a parent entity to its child entity.

REMOVE is similar to a delete command. Specifying a CascadeType of REMOVE implies that a remove operation will be cascaded from a parent entity to its child entity.

REFRESH reloads the related entity from the database when the referring entity is refreshed.

If you do not specify a cascade type, no operations are cascaded.


No comments:

Post a Comment