Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
JPAContainer + Grid.setContainerDataSource()
Hello,
It seems that after recently Vaadin update, i can not use jpa container as datasource of grid since grid requires now an indexed container.
I've also done something like this :
JPAContainer<Entity> container = JPAContainerFactory.make(Entity.class, persistance_unit_name);grid.setContainerDataSource((Indexed) container);
But u can not cast jpa container to Container$Indexed so i've got an error.
I'm kind of newbie at using jpa container, so if there is anyone that might know how could i solve this kind of problem i would really be grateful.
Thanks in advance.
JPAContainer implements Indexed.Container interface, so the cast should be ok. Have you checked that you are using correct version. The newest version 4.0.0 is for Vaadin 8, use version 3.2.0 with Vaadin 7.x.
Hi,
Firstly i would like to thanks for your reply.
Actually i did check and i'm using the newest version of JPAContainer. I did implement it in my maven project by maven dependency.
Like this:
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>jpacontainer</artifactId>
<version>4.0.0</version>
</dependency>
Ok, its working now. Actually i did check my version of vaadin and it was 7.7.7 instead of 8 so that was a problem.
It's my bad and i'm sorry about it. Next time i will check everything more carefully.
Thanks again for your time.