Fix serializability of Vet

This commit is contained in:
Dave Syer 2017-02-03 10:02:07 +00:00
parent be13722cc5
commit 0a51540ad0
4 changed files with 50 additions and 4 deletions

View file

@ -15,19 +15,22 @@
*/
package org.springframework.samples.petclinic.model;
import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
/**
* Simple JavaBean domain object with an id property. Used as a base class for objects needing this property.
* Simple JavaBean domain object with an id property. Used as a base class for objects
* needing this property.
*
* @author Ken Krebs
* @author Juergen Hoeller
*/
@MappedSuperclass
public class BaseEntity {
public class BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected Integer id;

View file

@ -15,7 +15,6 @@
*/
package org.springframework.samples.petclinic.vet;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@ -44,7 +43,7 @@ import org.springframework.samples.petclinic.model.Person;
*/
@Entity
@Table(name = "vets")
public class Vet extends Person implements Serializable {
public class Vet extends Person {
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "vet_specialties", joinColumns = @JoinColumn(name = "vet_id"), inverseJoinColumns = @JoinColumn(name = "specialty_id"))