import java.io.Serializable; import java.util.Set; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; public class Profesor implements Serializable { private int id; @NotNull @Size(min = 3, max = 50) private String nombre; @NotNull @Size(min = 3, max = 50) private String ape1; @Size(min = 3, max = 50) private String ape2; public Profesor(){ } public Profesor(String nombre, String ape1, String ape2) { this.nombre = nombre; this.ape1 = ape1; this.ape2 = ape2; } }