mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:25:49 +00:00
Added serial version id to suppress warnings.
This commit is contained in:
parent
baf575a693
commit
0b5486c0b2
10 changed files with 52 additions and 0 deletions
|
@ -32,6 +32,10 @@ import javax.persistence.MappedSuperclass;
|
|||
@MappedSuperclass
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -3856744164839586177L;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer id;
|
||||
|
|
|
@ -28,6 +28,10 @@ import javax.persistence.MappedSuperclass;
|
|||
@MappedSuperclass
|
||||
public class NamedEntity extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1827620691768236760L;
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
|
|
|
@ -27,6 +27,11 @@ import javax.validation.constraints.NotEmpty;
|
|||
@MappedSuperclass
|
||||
public class Person extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5934070342233945557L;
|
||||
|
||||
@Column(name = "first_name")
|
||||
@NotEmpty
|
||||
private String firstName;
|
||||
|
|
|
@ -46,6 +46,11 @@ import org.springframework.samples.petclinic.model.Person;
|
|||
@Table(name = "owners")
|
||||
public class Owner extends Person {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -916637073264067654L;
|
||||
|
||||
@Column(name = "address")
|
||||
@NotEmpty
|
||||
private String address;
|
||||
|
|
|
@ -48,6 +48,11 @@ import org.springframework.samples.petclinic.visit.Visit;
|
|||
@Table(name = "pets")
|
||||
public class Pet extends NamedEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4327953478894967506L;
|
||||
|
||||
@Column(name = "birth_date")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
|
|
@ -27,4 +27,9 @@ import org.springframework.samples.petclinic.model.NamedEntity;
|
|||
@Table(name = "types")
|
||||
public class PetType extends NamedEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -7611995145056548231L;
|
||||
|
||||
}
|
||||
|
|
|
@ -31,4 +31,9 @@ import org.springframework.samples.petclinic.model.NamedEntity;
|
|||
@Table(name = "specialties")
|
||||
public class Specialty extends NamedEntity implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2199617339964039700L;
|
||||
|
||||
}
|
||||
|
|
|
@ -45,6 +45,10 @@ import org.springframework.samples.petclinic.model.Person;
|
|||
@Table(name = "vets")
|
||||
public class Vet extends Person {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 2216866745632621103L;
|
||||
@ManyToMany(fetch = FetchType.EAGER)
|
||||
@JoinTable(name = "vet_specialties", joinColumns = @JoinColumn(name = "vet_id"),
|
||||
inverseJoinColumns = @JoinColumn(name = "specialty_id"))
|
||||
|
|
|
@ -35,6 +35,11 @@ import org.springframework.samples.petclinic.model.BaseEntity;
|
|||
@Table(name = "visits")
|
||||
public class Visit extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1400610663349907927L;
|
||||
|
||||
@Column(name = "visit_date")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate date;
|
||||
|
|
|
@ -80,11 +80,21 @@ class PetTypeFormatterTests {
|
|||
private List<PetType> makePetTypes() {
|
||||
List<PetType> petTypes = new ArrayList<>();
|
||||
petTypes.add(new PetType() {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4182992965923515553L;
|
||||
|
||||
{
|
||||
setName("Dog");
|
||||
}
|
||||
});
|
||||
petTypes.add(new PetType() {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1823182409934678856L;
|
||||
|
||||
{
|
||||
setName("Bird");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue