springframeworkguru / sfg-pet-clinic

SFT Pet Clinic
232 stars 1.99k forks source link

pet.setOwner(owner) should be added in /pets/new #106

Open aCodeRancher opened 5 years ago

aCodeRancher commented 5 years ago

Hi, in pet-clinic-web, PetController.java, after line 68, pet.setOwner(owner) should be added , even though the cascade type = All for Pet entity. When a pet is added, the owner adds the pet and the pet should add the owner. If this line is not added, in the database, the Pet's owner is Null.