Table + Hbncontainer + POJO class

Hi everyone!

I just start using vaadin but im with some difficults, especially when im using hbncontainer + pojo class.

I’m doing a simple application with a Table that is filled with Hbncontainer from two POJO class. My question, its possible to send ALL the pojos fields (parent & child(s)) to Hbncontainer so we can show the propertys on table?

Imagine this:

persons (id, name, phone_number_id) (parent)
phone_numbers(id, number) (child)

I’ve done the mapping using annotations with all the relations between persons and phone_numbers, but when im showing the data on the table, the hbncontainer only has the fields (own fields and relation) from persons pojo.

When i get the propertys from the container (hbn.getContainerPropertyIds():wink: i get someting like [id, name, phoneNumbersId]
(phoneNumbersId is the mapped field to pojo phone_numbers).

It’s possible to get something like [id, name, phone_number_id, number]
in the hbncontainer ?

Ty in advance.

VizRS

Can i have some help about this ?

VizRS

I don’t think so. This is one of the reasons I wrote BeanTupleContainer (see this
add-on
which run happily over Hibernate, but using JPA) so I could arbitrarily join things together, and avoid the pitfalls discussed in
this article

Ty for your response Jean.

So, basically we can’t get a field from a pojo that is related to another when we are using the Hbncontainer?

I know we can use a generated column for the id that comes from the relation with two pojos, but imagine that the child class has 10 fields… we can’t show the fields in the table ??

VizRS