Skip to content

Several possible typos in the code #3

@rillig

Description

@rillig

First, thank you for writing the whole code. It was really enlightening to see how well-structured and educating it is. When I used your code as a basis for having my own persistent types, I stumbled upon several small issues in the code. Some are probably typos, but with some others I'm not sure.

CreateCityDto uses var, while UpdateCityDto uses val. Is that intentional?

The CreateCityDto uses Hibernate annotations. This contradicts the purpose of the DTO to abstract from the persistence layer. Is that intentional?

In the UpdateCityDto, how would I specify that I want to delete the description? Setting it to null currently keeps the previous description.

In the JpaCityService, you sometimes use cityId and sometimes id as parameter name. Is there a reason for this?

One of the log messages in JpaCityService uses an uppercase City, the others use the lowercase city. Probably a typo.

In the JpaCityService, you chose the variable name cityRepo. In the corresponding test, you named it repository. Any reason for the different names?

In the JpaCityServiceTest, you declared var softly even though val softyl would be enough. Any specific reason for that?

The JpaCityServiceTest.'updateCity' should update existing values test checks the updatedAt property twice.

The method CityController.addCity has a CityDto as parameter, which violates the separation of layers. This should rather be a CityResource.

In log4j2.yml, the word Configutation looks like a typo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions