java - What is difference between Hibernate EAGER fetch and cascade-type all -


please explain difference between hibernate eager fetching , cascade-type all.

in both configuration can load child object associated parent, difference between in.

its simple :consider 2 entities 1. department , 2. employee , have one-to-many mappings.that 1 department can have many employee cascade=cascadetype.all , means change happened on departmententity must cascade employeeentity well. if save department , associated employee saved database. if delete department employee associated department deleted.
cascade-type combination of persist, remove ,merge , refresh cascade types. example cascade type

fetch type eager opposite of lazy.lazy default fetch type hibernate annotation relationships. when use lazy fetch type, hibernate won’t load relationships particular object instance. eager default load of relationships related particular object loaded hibernate.click here example.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -