Added serial version id to suppress warnings.

This commit is contained in:
Awadhesh Kumar 2020-04-26 10:05:14 +05:30
parent baf575a693
commit 0b5486c0b2
10 changed files with 52 additions and 0 deletions

View file

@ -32,6 +32,10 @@ import javax.persistence.MappedSuperclass;
@MappedSuperclass @MappedSuperclass
public class BaseEntity implements Serializable { public class BaseEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3856744164839586177L;
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id; private Integer id;

View file

@ -28,6 +28,10 @@ import javax.persistence.MappedSuperclass;
@MappedSuperclass @MappedSuperclass
public class NamedEntity extends BaseEntity { public class NamedEntity extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = -1827620691768236760L;
@Column(name = "name") @Column(name = "name")
private String name; private String name;

View file

@ -27,6 +27,11 @@ import javax.validation.constraints.NotEmpty;
@MappedSuperclass @MappedSuperclass
public class Person extends BaseEntity { public class Person extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = -5934070342233945557L;
@Column(name = "first_name") @Column(name = "first_name")
@NotEmpty @NotEmpty
private String firstName; private String firstName;

View file

@ -46,6 +46,11 @@ import org.springframework.samples.petclinic.model.Person;
@Table(name = "owners") @Table(name = "owners")
public class Owner extends Person { public class Owner extends Person {
/**
*
*/
private static final long serialVersionUID = -916637073264067654L;
@Column(name = "address") @Column(name = "address")
@NotEmpty @NotEmpty
private String address; private String address;

View file

@ -48,6 +48,11 @@ import org.springframework.samples.petclinic.visit.Visit;
@Table(name = "pets") @Table(name = "pets")
public class Pet extends NamedEntity { public class Pet extends NamedEntity {
/**
*
*/
private static final long serialVersionUID = 4327953478894967506L;
@Column(name = "birth_date") @Column(name = "birth_date")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate birthDate; private LocalDate birthDate;

View file

@ -27,4 +27,9 @@ import org.springframework.samples.petclinic.model.NamedEntity;
@Table(name = "types") @Table(name = "types")
public class PetType extends NamedEntity { public class PetType extends NamedEntity {
/**
*
*/
private static final long serialVersionUID = -7611995145056548231L;
} }

View file

@ -31,4 +31,9 @@ import org.springframework.samples.petclinic.model.NamedEntity;
@Table(name = "specialties") @Table(name = "specialties")
public class Specialty extends NamedEntity implements Serializable { public class Specialty extends NamedEntity implements Serializable {
/**
*
*/
private static final long serialVersionUID = 2199617339964039700L;
} }

View file

@ -45,6 +45,10 @@ import org.springframework.samples.petclinic.model.Person;
@Table(name = "vets") @Table(name = "vets")
public class Vet extends Person { public class Vet extends Person {
/**
*
*/
private static final long serialVersionUID = 2216866745632621103L;
@ManyToMany(fetch = FetchType.EAGER) @ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "vet_specialties", joinColumns = @JoinColumn(name = "vet_id"), @JoinTable(name = "vet_specialties", joinColumns = @JoinColumn(name = "vet_id"),
inverseJoinColumns = @JoinColumn(name = "specialty_id")) inverseJoinColumns = @JoinColumn(name = "specialty_id"))

View file

@ -35,6 +35,11 @@ import org.springframework.samples.petclinic.model.BaseEntity;
@Table(name = "visits") @Table(name = "visits")
public class Visit extends BaseEntity { public class Visit extends BaseEntity {
/**
*
*/
private static final long serialVersionUID = -1400610663349907927L;
@Column(name = "visit_date") @Column(name = "visit_date")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate date; private LocalDate date;

View file

@ -80,11 +80,21 @@ class PetTypeFormatterTests {
private List<PetType> makePetTypes() { private List<PetType> makePetTypes() {
List<PetType> petTypes = new ArrayList<>(); List<PetType> petTypes = new ArrayList<>();
petTypes.add(new PetType() { petTypes.add(new PetType() {
/**
*
*/
private static final long serialVersionUID = 4182992965923515553L;
{ {
setName("Dog"); setName("Dog");
} }
}); });
petTypes.add(new PetType() { petTypes.add(new PetType() {
/**
*
*/
private static final long serialVersionUID = 1823182409934678856L;
{ {
setName("Bird"); setName("Bird");
} }