Removed unused imports

Made some variables as final
This commit is contained in:
ghost 2024-09-24 04:44:04 +02:00 committed by Dave Syer
parent d90e284621
commit 2daa3993ee
4 changed files with 3 additions and 7 deletions

View file

@ -18,11 +18,7 @@ package org.springframework.samples.petclinic;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportRuntimeHints;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import java.util.Locale;
/**
* PetClinic Spring Boot Application.

View file

@ -62,7 +62,7 @@ public class Owner extends Person {
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "owner_id")
@OrderBy("name")
private List<Pet> pets = new ArrayList<>();
private final List<Pet> pets = new ArrayList<>();
public String getAddress() {
return this.address;

View file

@ -17,7 +17,7 @@ package org.springframework.samples.petclinic.owner;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

View file

@ -55,7 +55,7 @@ public class Pet extends NamedEntity {
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "pet_id")
@OrderBy("visit_date ASC")
private Set<Visit> visits = new LinkedHashSet<>();
private final Set<Visit> visits = new LinkedHashSet<>();
public void setBirthDate(LocalDate birthDate) {
this.birthDate = birthDate;