Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ public class Person extends BaseEntity {
@NotBlank
private String firstName;

@Column(name = "middle_name") // <-- ADD THIS LINE
private String middleName;

@Column(name = "mother_name") // <-- ADD THIS LINE
private String mothername;

@Column(name = "last_name")
@NotBlank
private String lastName;
Expand All @@ -51,4 +57,20 @@ public void setLastName(String lastName) {
this.lastName = lastName;
}

public void setMiddleName(String middleName) {
this.middleName = middleName;
}

public String getMiddleName() {
return this.middleName;
}

public void setMotherName(String motherName) {
this.motherName = motherName;
}

public String getMotherName() {
return this.motherName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ protected Set<Specialty> getSpecialtiesInternal() {

@XmlElement
public List<Specialty> getSpecialties() {
// This is safe because we return a copy
return getSpecialtiesInternal().stream()
.sorted(Comparator.comparing(NamedEntity::getName))
.collect(Collectors.toList());
}

public int getNrOfSpecialties() {
// This method is for the convenience of unit tests
return getSpecialtiesInternal().size();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,28 @@ public String showVetList(@RequestParam(defaultValue = "1") int page, Model mode
}

private String addPaginationModel(int page, Page<Vet> paginated, Model model) {
// Get content for page object
List<Vet> listVets = paginated.getContent();
model.addAttribute("currentPage", page);
model.addAttribute("totalPages", paginated.getTotalPages());
model.addAttribute("totalItems", paginated.getTotalElements());
model.addAttribute("listVets", listVets);
return "vets/vetList";
}


private Page<Vet> findPaginated(int page) {
int pageSize = 5;
//test changes
int count = 10;
System.out.println("count: " + count);
Pageable pageable = PageRequest.of(page - 1, pageSize);
return vetRepository.findAll(pageable);
}

@GetMapping({ "/vets" })
public @ResponseBody Vets showResourcesVetList() {
// This is a test comment to trigger the analysis.
// Here we are returning an object of type 'Vets' rather than a collection of Vet
// objects so it is simpler for JSon/Object mapping
Vets vets = new Vets();
Expand Down