documentacion jpa
TRANSCRIPT
![Page 1: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/1.jpg)
Documentación sobre JPA
1
Hibernate y Maven
Hibernate y Maven
![Page 2: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/2.jpg)
Documentación sobre JPA
2
src/main/resources/META-‐INF/persistence.xml
Persistence unit
EnDtyManager
![Page 3: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/3.jpg)
Documentación sobre JPA
3
EnDtyManager
• Las operaciones con las enDdades deben hacerse en el contexto de una transacción
Transacciones
![Page 4: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/4.jpg)
Documentación sobre JPA
4
Lazy y Eager load
Operaciones en cascada
![Page 5: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/5.jpg)
Documentación sobre JPA
5
Operaciones en cascada
Mapeado Objeto-‐relacional
![Page 6: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/6.jpg)
Documentación sobre JPA
6
Generación de IDs
Embedded objects
![Page 7: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/7.jpg)
Documentación sobre JPA
7
Element CollecDons
• Según cardinalidad – Many-‐to-‐One – One-‐to-‐One – One-‐to-‐Many – Many-‐to-‐Many
• Según dirección – Bidireccionales – Unidireccionales
Tipos de mapping
Asociaciones de valor único
Asociaciones de valor múlDple
![Page 8: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/8.jpg)
Documentación sobre JPA
8
Many-‐to-‐One unidireccional
One-‐to-‐One unidireccional
![Page 9: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/9.jpg)
Documentación sobre JPA
9
One-‐to-‐One bidireccional
One-‐to-‐many/Many-‐to-‐one bidireccional
![Page 10: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/10.jpg)
Documentación sobre JPA
10
Many-‐to-‐many bidireccional
One-‐to-‐many unidireccional
![Page 11: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/11.jpg)
Documentación sobre JPA
11
Herencia
Estrategia de única tabla
![Page 12: documentacion JPA](https://reader033.vdocuments.net/reader033/viewer/2022061303/54f5d7a84a7959e9378b4f25/html5/thumbnails/12.jpg)
Documentación sobre JPA
12
Estrategia de Joined table
Estrategia de tabla por clase concreta