Use-case 0003 Implementation - Add a Pet
Initiating actor: Pet Owner
Other actors: None
Description: A pet owner wants to add a new animal to their profile so they can request services for it. The system provides available pet categories for them to choose from, and then saves the new pet profile into the database.
Scenario:
- Pet Owner opens the "My Pets" page and clicks "Add new pet".
Hibernate:
select
p1_0.pet_id,
p1_0.age,
p1_0.description,
p1_0.name,
p1_0.owner_id,
p1_0.pettype_id,
p1_0.photo,
p1_0.special_needs
from
project.pets p1_0
left join
project.pet_owners o1_0
on o1_0.user_id=p1_0.owner_id
where
o1_0.user_id=?
Hibernate:
select
po1_0.user_id,
po1_1.email,
po1_1.first_name,
po1_1.last_name,
po1_1.password,
po1_1.username
from
project.pet_owners po1_0
join
project.users po1_1
on po1_0.user_id=po1_1.user_id
where
po1_0.user_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
- System fetches all available pet species so the user can select one from a dropdown menu:
- Owner selects "Dog", fills in the pet's name, age, and needs, and submits the form.
- System creates the pet record in the database, linking it to the owner
Hibernate:
select
po1_0.user_id,
po1_1.email,
po1_1.first_name,
po1_1.last_name,
po1_1.password,
po1_1.username
from
project.pet_owners po1_0
join
project.users po1_1
on po1_0.user_id=po1_1.user_id
where
po1_0.user_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
Hibernate:
insert
into
project.pets
(age, description, name, owner_id, pettype_id, photo, special_needs, pet_id)
values
(?, ?, ?, ?, ?, ?, ?, ?)
Hibernate:
select
p1_0.pet_id,
p1_0.age,
p1_0.description,
p1_0.name,
p1_0.owner_id,
p1_0.pettype_id,
p1_0.photo,
p1_0.special_needs
from
project.pets p1_0
left join
project.pet_owners o1_0
on o1_0.user_id=p1_0.owner_id
where
o1_0.user_id=?
Hibernate:
select
po1_0.user_id,
po1_1.email,
po1_1.first_name,
po1_1.last_name,
po1_1.password,
po1_1.username
from
project.pet_owners po1_0
join
project.users po1_1
on po1_0.user_id=po1_1.user_id
where
po1_0.user_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
Hibernate:
select
pt1_0.pettype_id,
pt1_0.needs_outdoor_walk,
pt1_0.species
from
project.pet_types pt1_0
where
pt1_0.pettype_id=?
Last modified
7 days ago
Last modified on 05/18/26 23:56:25
Attachments (2)
- UC0003-1.png (19.1 KB ) - added by 7 days ago.
- UC0003-2.png (8.7 KB ) - added by 7 days ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.


