Question: you are given a spring boot version 2 y z You are given a springboot version 2 . 0 . 5 application with database access

you are given a spring boot version2yzYou are given a springboot version 2.0.5 application with database access already configured. The database contains two tables ( person and pet)
A person can have many pets and every pet has an owner.
Database schema
CREATE TABLE person(
Id bigint not null,
First_name varchar(50) not null,
Primary key (id)
);
CREATE TABLE pet(
Id bigint Not null,
name varchar (50) not null,
Primary key (id)
);
Alter table pet
Add foreign key ( owner_id)
References person(id)
Requirements
1.Register the person service as a spring bean.
2. Model the relay between Pet and Person by creating class fields. Add appropriate hibernate / JPA annotations.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!