Creating entities by calling a constructor

Hi,

I’m wondering, if it is necessary to always use DataManager to create all the entities? It is said here , that it’s needed to “initialize fields annotated with @JmixGeneratedValue and invoke @PostConstruct methods”. But do I really need to use DataManager with my DTO’s, that do not have those annotations? Is there any other reason to have a dependency to the DataManager?

Hi,

If you are talking about any DTO or POJO, you don’t need dataManager to instantiate them. It is only for entities (non persistent and persistent ones).

Cheers
Mario

1 Like

Thank you! I was just a bit confused by a warning “Jmix: Entity is created by calling constructor.”