Skip to content
Snippets Groups Projects
Commit 0e60b037 authored by Mic's avatar Mic
Browse files

fixed naming issue in vet list

parent 47ddd6f9
No related branches found
No related tags found
No related merge requests found
......@@ -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";
}
......
......@@ -24,10 +24,10 @@
<tbody>
<c:forEach var="vet" items="${vets.vetList}">
<tr>
<td>${vet.firstName} ${vet.lastName}</td>
<td><c:out value="${vet.firstName} ${vet.lastName}" /></td>
<td>
<c:forEach var="specialty" items="${vet.specialties}">
${specialty.name}
<c:out value="${specialty.name}" />
</c:forEach>
<c:if test="${vet.nrOfSpecialties == 0}">none</c:if>
</td>
......
......@@ -56,7 +56,7 @@
<!-- - The AtomView rendering a Atom feed of the visits -->
<bean id="visitList" class="org.springframework.samples.petclinic.web.VisitsAtomView"/>
<bean id="vets/vetsList" class="org.springframework.web.servlet.view.xml.MarshallingView">
<bean id="vets/vetList" class="org.springframework.web.servlet.view.xml.MarshallingView">
<property name="marshaller" ref="marshaller"/>
</bean>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment