From 6de4c6fe1469d49597e579f85b5dac8c75299fee Mon Sep 17 00:00:00 2001 From: Irfankcss <122486828+Selms4@users.noreply.github.com> Date: Thu, 27 Jun 2024 23:49:27 +0200 Subject: [PATCH] Default pet added --- .../eps/softarch/demo/config/DBInitialization.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/cat/udl/eps/softarch/demo/config/DBInitialization.java b/src/main/java/cat/udl/eps/softarch/demo/config/DBInitialization.java index 23c07dd..efd4337 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/config/DBInitialization.java +++ b/src/main/java/cat/udl/eps/softarch/demo/config/DBInitialization.java @@ -175,6 +175,18 @@ public void initializeDatabase() { pet.setImg("https://www.aon.es/personales/seguro-perro-gato/wp-content/uploads/sites/2/2021/06/pastor-aleman-3.jpg"); petRepository.save(pet); } + if (!petRepository.existsById(3L)) { + Pet pet = new Pet(); + pet.setName("Fifi"); + pet.setColor("White"); + pet.setSize("Small"); + pet.setWeight(12D); + pet.setAge("3 years old"); + pet.setDescription("Likes to relax and cuddle"); + pet.setBreed("Croatishe pupi"); + pet.setImg("https://hips.hearstapps.com/hmg-prod/images/bichon-frise-1660897169.jpg?crop=0.6666666666666666xw:1xh;center,top&resize=980:*"); + petRepository.save(pet); + } //One of them favourited to test functionality if(!favouritedPetsRepository.existsById(1L)){ FavouritedPets favPets = new FavouritedPets();