18.01.2015 Views

Apartado 3.6: Conceptos Avanzados de Hibernate

Apartado 3.6: Conceptos Avanzados de Hibernate

Apartado 3.6: Conceptos Avanzados de Hibernate

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Opcionalidad en las relaciones (1)<br />

<br />

Ejemplo: Department<br />

<br />

<br />

<br />

<br />

El mo<strong>de</strong>lo permite que un <strong>de</strong>partamento no tenga un<br />

director asociado, e incluso que no tenga empleados<br />

Supongamos que recuperamos un <strong>de</strong>partamento sin director<br />

asociado y sin empleados<br />

¿Qué <strong>de</strong>vuelve getDirector()<br />

<br />

Devuelve null<br />

¿Qué <strong>de</strong>vuelve getEmployees()<br />

<br />

Una colección (en este caso un Set) vacía

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!