Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
JPA Best Practices Webinar
Join Vaadin's Thomas Mattsson and Matti Tahvonen to get more familiar with JPA. Everything from Deltaspike to pure JPA and how to use it with Vaadin for binding your data to your UI and the other way around. This is both an introduction as well as a best practices webinar.Post your questions beforehand below.
The webinar takes place on December 17th 2015 @ 2PM CET
Is there going to be continued support for JPAContainer? (asking because nothing seems to have happened there recently and it is still usefull for small CRUD projects after all)
The example project we used in the webinar is available on github:
Daniel, there are currently no big plans for JPAContainer, but it is still maintained if there are some critical bugs in it. Instead we are planning to come up with lazy loading solutions and improved basic data binding to core components, same sort of stuff that there is in Viritin add-on. And BTW, the setup we repsented in this webinar (EJB, DeltaSpikeData + Viritin for lazy loading) is pretty efficient for small CRUD projects as well ;-)
what about filtering and lazy loading? From the user interface perspective filtering should be able to filter all database entries as well. Is this covered by this mechanism when using the MTable?
I think I need to checkout the project. I watched the webinar completly, but the "Filter" TextField above the table was not involved in the webinar.
We use for example Searchfields to limit the amout of data which might be interessting for an user. After loading the data via spring data we provide filtering on the data we "found" via search-service (overall max size is limited by service).
The filter mechanism (in this case with the FilteringTable addon) is usefull for the Users to differentiate on a more detailed level. <- We don't want to have a searchfield for every property from our entities.
In your example there is nothing like a searchfield. So my question is, does the filter field above the table just affect the already loaded items?
UI Visible Entries (nothing more is fetched lazy):
Filtering TextField with value: Ro
What will happen? Is the users expectation correct?
I hope its not to specific.
The filtering in the example is dealt at the database level, the filter text is given to EJB method call-> then to repository-> query -> database. If you only want to filter the existing result set, it is really easy and fast to do that in the JVM memory.
So user expectation is correct, but it's filtering by query and not as i assumed filtering on loaded data.
Matti, thank you for your time.
I have question about the ManyToMany relationship.. the ManyToMany which is mapp to other table, its data is not updating even though I refresh the page..
What is the cause on this situation sir ? :)
Depending how the relation is declared JPA might need you to updated from the opposite side as well, and possibly save also the other side of the entity. If you are using MultiSelectTable from Viritin, you can use the hooks presented in this test case:
Thank you sir Matti :)
Vaadin legends please lend me your ear. So just started playing with Vaadin and Spring-Boot and I have attached a very very simple @ManyToMany relationship in H2 with Vaadin front end.
Unfortunatly the magic Service "load fully" hack as done in the video gives me no joy. Is it less straight forward in Spring? I think being very naive about my implimentation but unfortunately not wise enough to figure out what's missing (exhausted google). If someone could please supply some guidance in moving over to a Lazy load stratagy I would really appreciate it.
*Note if I change the relationships to eager all is well
Matti Tahvonen: Hi,
Check ou the end of the webinar. There is an example how you can do a really efficient lazy loading (to database) with Viritin (MTable in this case). AFAIK it is the best performing solution available and also pretty easy to set up. You can also configure the batch size it uses to make backend queries with overloaded methods/constructors. The example also has filtering and if works with the lazy loading as well.
That is a great video on webinar. A wonderful starting point to learn how to do webinar efficiently.