mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-25 03:42:48 +00:00
Add petName field for form binding
This commit is contained in:
parent
d7ece043ac
commit
0f2eccc384
1 changed files with 16 additions and 1 deletions
|
@ -65,6 +65,13 @@ public class Owner extends Person {
|
|||
@OrderBy("name")
|
||||
private final List<Pet> pets = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* This field is used for form binding for pet search
|
||||
* and is not persisted to the database.
|
||||
*/
|
||||
@jakarta.persistence.Transient
|
||||
private String petName;
|
||||
|
||||
public String getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
@ -172,4 +179,12 @@ public class Owner extends Person {
|
|||
pet.addVisit(visit);
|
||||
}
|
||||
|
||||
}
|
||||
public String getPetName() {
|
||||
return this.petName;
|
||||
}
|
||||
|
||||
public void setPetName(String petName) {
|
||||
this.petName = petName;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue