Ejemplo de paginación (Listado de preguntas pendientes) con primefaces

utilizando LazyDataModel, con recarga automática de la página
solicitada.
This commit is contained in:
Marcos Garcia Nuñez
2019-12-16 22:02:27 +01:00
parent dcbebe5253
commit 9bfdebbea4
12 changed files with 250 additions and 54 deletions

View File

@@ -1,7 +1,7 @@
package jpa;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -28,7 +28,7 @@ public class FamilyDoctorJPA implements Serializable {
@Id
@Column(updatable = false)
@GeneratedValue(strategy=GenerationType.IDENTITY)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(nullable = false, unique = true)
private String professionalNumber;
@@ -39,9 +39,9 @@ public class FamilyDoctorJPA implements Serializable {
private String email;
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "FamilyDoctorId")
private Collection<PatientJPA> patients;
private List<PatientJPA> patients;
@ManyToOne
@JoinColumn (name="PrimaryHealthCareCenterId")
@JoinColumn(name = "PrimaryHealthCareCenterId")
private PrimaryHealthCareCenterJPA primaryHealthCareCenter;
/**
@@ -111,20 +111,22 @@ public class FamilyDoctorJPA implements Serializable {
/**
* Metodos para get/set de relaciones (pacientes)
*
* @return
*/
public Collection<PatientJPA> getPatients() {
public List<PatientJPA> getPatients() {
return patients;
}
public void setPatients(Collection<PatientJPA> patients) {
public void setPatients(List<PatientJPA> patients) {
this.patients = patients;
}
public PrimaryHealthCareCenterJPA getPrimaryHealthCareCenter() {
return primaryHealthCareCenter;
}
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
public void setPrimaryHealthCareCenter(PrimaryHealthCareCenterJPA center) {
this.primaryHealthCareCenter = center;
}