Skip to content

HomeWork has been completed#70

Open
Hlvi2006 wants to merge 31 commits intoironhack-labs:mainfrom
Hlvi2006:main
Open

HomeWork has been completed#70
Hlvi2006 wants to merge 31 commits intoironhack-labs:mainfrom
Hlvi2006:main

Conversation

@Hlvi2006
Copy link
Copy Markdown

No description provided.

public Teacher updatePartially(String id,Teacher teacher){
Teacher updatedTeacher = getTeacherById(id);
if(teacher.getName()!= null) updatedTeacher.setName(teacher.getName());
if(teacher.getSalary() != 0) updatedTeacher.setSalary(teacher.getSalary());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

teacher.getSalary() != null
You are using correctly the wrapper Double and not the primitive double in your model. Check for null.

If you want to also check for positive values you can do that on validation for example.

import java.util.List;

@Service
@RequestMapping("/student")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a @RequestMapping doing here in services?

@ahpoise
Copy link
Copy Markdown

ahpoise commented Mar 12, 2026

Adding exception handling would be good.
Also on the students controllers @Valid is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants