How to persist data in the new grid

I’m developing an application that uses spring-boot and vaadin. The data for the grid were loaded via a BeanItemContainer.

BeanItemContainer memberBeanItemContainer = new BeanItemContainer(Member.class, memberRepository.findAll());

My Question is, how were the data stored to my database? When I use the inline editor from the grid, I can edit a row, click save, but the changed data weren’t saved to the database. Do I have to do some extra action or configuration?

The MemberRepository Class:
public interface MemberRepository extends JpaRepository<Member, Integer> { }

Hi Marco,

The changes you make in the editor are stored in the Member beans inside of the BeanItemContainer. However the BeanItemContainer does not work with the backend directly, so you need to commit the changes from the Member beans to the backend by yourself.

You can also use the LazyQueryContainer which should call all the appropriate methods in the repository.

See code example by Matti Tahvonen and consider the use of LazyQueryContainer.