3

I want to insert data from multiple objects (eg. from 2 Spring Data entities); I know how to make left join from multiple entities, but I'm not sure how to make Custom object from that...

Kris_1313
  • 79
  • 9

1 Answers1

3

In Vaadin Grid is typed using generics. For example: Grid<Person>. You cannot have multiple types here.

If you need to join data from multiple objects, you must create a middle layer to produce DTO (Data Transfer Object). The DTO collects properties from multiple source objects. This is a common practice in more complex business application, not limited to Vaadin.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
Tatu Lund
  • 9,949
  • 1
  • 12
  • 26
  • By the way, the new [*Records* (JEP 359)](https://openjdk.java.net/jeps/359) feature being previewed in Java 14 may help with this kind of work. – Basil Bourque Jan 02 '20 at 01:47