Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
persistentes en JPA
Sistema de Persistencia de
Objetos
nov-08
alb@uniovi.es
JVM
nov-08
Dirty-checking
Write-behind
alb@uniovi.es
nov-08
Estados de persistencia
Transient
Persistent
Detached
Removed
nov-08
nov-08
alb@uniovi.es
nov-08
alb@uniovi.es
alb@uniovi.es
Sincronizacin de la sesin y
la BBDD
entityManager.setFlushMode()
nov-08
FlushMode.AUTO
FlushMode.COMMIT
FlushMode.MANUAL slo hibernate
alb@uniovi.es
API de EntityManager
nov-08
alb@uniovi.es
10
APIs JPA
alb@uniovi.es
11
mbito de persistencia
nov-08
alb@uniovi.es
12
Gestionando objetos
13
Gestionando objetos
Gestin ms correcta de la
sesin y transaccin:
control de las excepciones
nov-08
alb@uniovi.es
14
nov-08
alb@uniovi.es
15
find() o getReference() ?
Si no existe en BDD:
find() devuelve null
getReference() devuelve un proxy
Que puede lanzar EntityNotFoundException
nov-08
alb@uniovi.es
16
nov-08
alb@uniovi.es
17
nov-08
alb@uniovi.es
18
nov-08
alb@uniovi.es
19
nov-08
alb@uniovi.es
20
nov-08
alb@uniovi.es
21
alb@uniovi.es
22
Si existe en BDD
Si no esta en BDD
nov-08
23
Flushing el contexto de
persistencia
FlushMode.AUTO
Commit
Query
em.flush()
FlushMode.COMMIT
Commit
em.flush()
nov-08
alb@uniovi.es
24