Skip to content

OpenUI5 boilerplate based on OLingo, JPA and Spring Boot

TL;DR: https://github.com/jpenninkhof/odata-boilerplate/

It happens quite often that you quickly want to get something running with OpenUI5 and OData, quickly smack it on a web-server or cloud instance, but just don’t look forward building the project completely start from scratch. Think hackathons, in which time is very limited already… That’s when an OpenUI5 boilerplate would come in handy.

That’s why I have compiled a relatively small application that connects to a database (mysql by default), builds to a jar, allows you to model your data using JPA (and the JPA diagram editor), exposes the model through OData and has a tiny OpenUI5 application that uses the OData and shows the content of the database.

For convenience, a base-diagram for the JPA diagram editor has been provided as well. Once the datamodel is finished, the application with update the data model of the connected database on first run.

By default, the application comes with just one entity: Members, that is automatically populated with a few names from Application.java

Once the application is running, you can browse to http://localhost:8080 to run the sample OpenUI5 application that is using the OData service. The service itself is available from http://localhost:8080/odata.svc.

The only thing you need for this, is a local install of Maven and Java 1.8, once you have that just clone the github repository to your computer:

Modify file “/src/main/resources/application.properties” to connect to your own database.

And run it:

On first run, the application will introspect the database that it has been connected to, and will make sure the database is in sync with it’s internal model. If necessary tables will be created or altered.

And with that, you’re ready to run the OpenUI sample app from http://localhost:8080/openui5-boilerplateContributions are welcome. Just fork it and submit a pull request.

Related links:

Published inTechnoblog

One Comment

  1. Sarah Soh Sarah Soh

    Many thanks for sharing this.

    To ensure that the consumers of the service are not getting excessive amount of data, I intend to set a timeout for the OData calls. I tried setting server.session.timeout and server.connection-timeout in application.properties. However, it does not work.

    Would you be able to advise how I can get the timeout to work?

    Appreciate your help. Many thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *

two × 4 =