Skip to content

Entity generated with a mapping using a dto should not have a @JsonIgnoreProperties #29835

@henri-tremblay

Description

@henri-tremblay
Overview of the issue

Entities that are mapped to a DTO are new serialized. So they don't need json annotations

Motivation for or Use Case

Unnecessary code generated

Reproduce the error

Generate a project with a DTO mapping.
Create an entity with a relationship
There will be a @JsonIgnoreProperties annotation added

Related issues

N/A

Suggest a Fix

Add the annotation only when the domain object is directly returned to the UI.
It's done in _persistClass_.java.jhi.jakarta_persistence.ejs line 106.
I could fix it but I'm not sure of the check that should be made.

JHipster Version(s)

8.11.0

Browsers and Operating System

Not important

  • Tickets opened without reproduction steps or that doesn't follows the template recommendation will be closed.
  • This issue is prompt-related or an error that prevents JHipster from generating an application.
  • I don't have a JDL otherwise I should open an JDL Issue
  • The application is not successfully generated otherwise, I should open an Issue with jhipster info
  • Checking this box is mandatory (this is just to show you read everything)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions