Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvysny/vaadin8-sqldataprovider-example
Demoes a SQLDataProvider and a Filter Bar for Vaadin 8 Grid
https://github.com/mvysny/vaadin8-sqldataprovider-example
grid sql vaadin vaadin8
Last synced: 15 days ago
JSON representation
Demoes a SQLDataProvider and a Filter Bar for Vaadin 8 Grid
- Host: GitHub
- URL: https://github.com/mvysny/vaadin8-sqldataprovider-example
- Owner: mvysny
- Created: 2018-09-05T08:24:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-21T23:15:19.000Z (almost 3 years ago)
- Last Synced: 2024-10-24T02:26:30.498Z (20 days ago)
- Topics: grid, sql, vaadin, vaadin8
- Language: Java
- Homepage: http://mavi.logdown.com/posts/7809634-using-sqldataprovider-with-vaadin-8-and-10
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Powered By Vaadin on Kotlin](http://vaadinonkotlin.eu/iconography/vok_badge.svg)](http://vaadinonkotlin.eu)
[![Build Status](https://travis-ci.org/mvysny/vaadin8-sqldataprovider-example.svg?branch=master)](https://travis-ci.org/mvysny/vaadin8-sqldataprovider-example)Vaadin 8 SQLDataProvider Example
=================================Demonstrates the use of a full-blown SQLDataProvider in a Vaadin 8 Grid.
Only requires a Servlet 3.0 container to run. Developed in a pure Java. Also demoes an auto-generated
Grid filter bar, therefore this example serves as a full replacement for Teppo Kurki's
[FilteringTable](https://vaadin.com/directory/component/filteringtable).The project uses code from [Vaadin-on-Kotlin](http://vaadinonkotlin.eu). The Kotlin stdlib is
only included as a run-time dependency - this project contains no Kotlin code and doesn't even
run the Kotlin compiler.The [live demo](https://vaadin8-sqldataprovider.herokuapp.com/) of this app runs on Heroku.
You can read more about the SQLDataProvider in the [Vaadin-on-Kotlin Databases Guide](http://www.vaadinonkotlin.eu/databases.html).
In short, SQLDataProvider uses [vok-orm](https://github.com/mvysny/vok-orm) to map JDBC ResultSet rows to Java objects.
The mapping directly maps column name to a bean property name; to modify the mapping just
use the `@As` annotation on your entity fields.Workflow
========To compile the entire project, run `./mvnw -C clean package` (or on Windows: `./mvnw.cmd -C clean package`).
To run the application, run `./mvnw -C jetty:run` and open http://localhost:8080/ .
> Jetty is a bit broken - at first it will show you a list of contexts which would indicate that the
app has not been deployed properly. Just refresh the page a couple of times - Jetty will eventually
be able to pick up the app and open it properly.To produce a deployable production mode WAR:
- change productionMode to true in the servlet class configuration (nested in the UI class)
- run "mvn clean package"
- test the war file with "mvn jetty:run-war"Client-Side compilation
-------------------------The generated maven project is using an automatically generated widgetset by default.
When you add a dependency that needs client-side compilation, the maven plugin will
automatically generate it for you. Your own client-side customizations can be added into
package "client".Debugging client side code
- run "mvn vaadin:run-codeserver" on a separate console while the application is running
- activate Super Dev Mode in the debug window of the applicationPlease read [Debugging Your Widgetset Components With SuperDevMode For Dummies](https://mvysny.github.io/Debugging-your-widgetset-components-with-superdevmode-for-dummies/)
for more info.Developing a theme using the runtime compiler
-------------------------When developing the theme, Vaadin can be configured to compile the SASS based
theme at runtime in the server. This way you can just modify the scss files in
your IDE and reload the browser to see changes.To use the runtime compilation, open pom.xml and comment out the compile-theme
goal from vaadin-maven-plugin configuration. To remove a possibly existing
pre-compiled theme, run "mvn clean package" once.When using the runtime compiler, running the application in the "run" mode
(rather than in "debug" mode) can speed up consecutive theme compilations
significantly.It is highly recommended to disable runtime compilation for production WAR files.
Using Vaadin pre-releases
-------------------------If Vaadin pre-releases are not enabled by default, use the Maven parameter
"-P vaadin-prerelease" or change the activation default value of the profile in pom.xml .