Question
You are given a spring boot application (version 2.0.5) with spring-boot-starter-data-jpa module included. Database access is fully configured.The database contains table person_data with columns: id
You are given a spring boot application (version 2.0.5) with spring-boot-starter-data-jpa module included. Database access is fully configured.The database contains table "person_data" with columns:
id (bigint)
first_name (varchar)
last_name (varchar)
All columns are not nullable
Tasks
Use annotations to configure Person class as hibernate entity that corresponds to table "person_data" Implement method getFulIName in Person class, so that it would return full name for given entity. For example: "John Smith" (when first_ name=John, last_name=Smith) Register PersonService class as spring bean Implement method findAll in PersonService. It should return all entities from database
Requirements
Names of classes Person and Person Service cannot be changed Sequence is not available Make sure to use proper types for fields eg. Person id should not be int
Hints
Do not use @GeneratedValue for id field eId will be enough.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started