mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-01-13 13:21:11 +00:00
fixed naming issue in vet list
This commit is contained in:
parent
47ddd6f934
commit
0e60b03708
4 changed files with 7 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
|
|
@ -27,7 +28,8 @@ import org.springframework.beans.support.PropertyComparator;
|
|||
@Entity @Table(name="vets")
|
||||
public class Vet extends Person {
|
||||
|
||||
@ManyToMany @JoinTable (name="vet_specialties",joinColumns = @JoinColumn(name = "vet_id"),
|
||||
@ManyToMany(fetch=FetchType.EAGER)
|
||||
@JoinTable (name="vet_specialties",joinColumns = @JoinColumn(name = "vet_id"),
|
||||
inverseJoinColumns= @JoinColumn(name = "specialty_id"))
|
||||
private Set<Specialty> specialties;
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class VetController {
|
|||
Vets vets = new Vets();
|
||||
vets.getVetList().addAll(this.clinicService.findVets());
|
||||
model.addAttribute("vets", vets);
|
||||
return "vets/vetsList";
|
||||
return "vets/vetList";
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue