Discussions

EJB programming & troubleshooting: EJB 3 CascadeType annotation not required? if specified on DB.

  1. EJB 3 CascadeType annotation not required? if specified on DB.

    Hi All,

    If I using on delete/update cascade on my DB , then is it required for me to use annotation at the entity level ? And if not used what will be the result?

    Whenever a entity manager remove/update is called entity , finally the request goes to DB and DB performs the cascade operations if any. But if that's the case then I am not able to understand why CacadeType annotation are introduced?


  2. nobody knows? or my question is wrong ? or am i missing something ?

    EJB 3 CascadeType annotation not required? if specified on DB.

    Hi All,

    If I using on delete/update cascade on my DB , then is it required for me to use annotation at the entity level ? And if not used what will be the result?

    Whenever a entity manager remove/update is called entity , finally the request goes to DB and DB performs the cascade operations if any. But if that's the case then I am not able to understand why CacadeType annotation are introduced?


  3. There may be some legacy DB systems which do not support cascade at data base level still can be used with EJB 3 in this case the cascade annotation is useful .Also if the cascade is not enabled at the database level this is useful for doing it from the entity manager/application code .