Skip to content

Support nested DTO mapping #2540

@belovaf

Description

@belovaf

Ebean perfectly supports fetching partial entities.
But it feels very error prone to return a partially loaded object for further processing.
Someone can accidentally access unloaded field and trigger lazy loading query.
I think it is a good idea to introduce a dto in such cases to prevent additional queries.
If someone wants to access an unloaded field he will be forced to update query and dto.

But currently ebean supports only plain dtos. This is not convenient to construct nested projections from a flat resultset manually.

It is possible to define new entity with @View annotation and map it to the same table, but it is not feels right.

May be a better option exists, can you explain, please, how do you solve such problems?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions