How to change values in Grid because of data relation

Good Morning from Germany,
i’m not so experienced so please forgive if the solution is obvious.
In my case we have a relation in Database, displayed by foreign keys, for example the object customer and ticket. In our java code the customer ID is a attribute of the ticket object.
Out target is to display the full name of the customer not the customerID (in a Grid). For Example in JavaFX it can be solved by using a cellvaluefactory, does vaadin have something similair or how i can solve this problem?

Greetings
B. Wiest
Dragon Consulting Minden UG

Hi,

You can use a lambda expression:

grid.addColumn(ticket -> customerService.getOne(ticket.getCustomerId()).setCaption("Customer name");

with customerService is your service or repository to retrive your customer by Id.
(It will display customer.toString(), you can also call getFullName())