mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-22 15:25:49 +00:00
adding POJOs
This commit is contained in:
parent
e4e044782e
commit
501885c54c
5 changed files with 79 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
package guru.springframework.springpetclinic.model;
|
||||
|
||||
public class Owner extends Person {
|
||||
public Owner(String firstName, String lastName) {
|
||||
super(firstName, lastName);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package guru.springframework.springpetclinic.model;
|
||||
|
||||
public class Person {
|
||||
private String firstName;
|
||||
private String lastName;
|
||||
|
||||
public Person(String firstName, String lastName) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package guru.springframework.springpetclinic.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class Pet {
|
||||
|
||||
private PetType petType;
|
||||
private Owner owner;
|
||||
private LocalDate birthDate;
|
||||
|
||||
public PetType getPetType() {
|
||||
return petType;
|
||||
}
|
||||
|
||||
public void setPetType(PetType petType) {
|
||||
this.petType = petType;
|
||||
}
|
||||
|
||||
public Owner getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(Owner owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public LocalDate getBirthDate() {
|
||||
return birthDate;
|
||||
}
|
||||
|
||||
public void setBirthDate(LocalDate birthDate) {
|
||||
this.birthDate = birthDate;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package guru.springframework.springpetclinic.model;
|
||||
|
||||
public class PetType {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package guru.springframework.springpetclinic.model;
|
||||
|
||||
public class Vet extends Person {
|
||||
public Vet(String firstName, String lastName) {
|
||||
super(firstName, lastName);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue