This project demonstrates a simple Spring Boot-application that uses Speedment Enterprise to
Speedment is configured in the pom.xml
-file to generate code then the project is built. You don't need any database connectivity to build since the src/main/json/speedment.json
-file constains all the database metadata. You will however need the Employees-database to run the application.
You can download the database from here.
To build the application, you also need to have a valid Speedment Enterprise license installed on your computer or specified in the project pom.xml. You can get a trial license here for free.
Launch the application by calling:
mvn spring-boot:run
To use a different database user than root
with password password
, use the following parameters:
mvn spring-boot:run \
-Dspring.datasource.username=your_username \
-Dspring.datasource.password=your_password
You can call two different endpoints, one that use regular JDBC and one that uses Speedment. Both expects a from
and a to
argument to be specified formatted like YYYY-MM-DD
.
Example:
curl "localhost:9783/jdbc?from=1988-01-01&to=1989-01-01"
curl "localhost:9783/speedment?from=1988-01-01&to=1989-01-01"
Copyright 2017 Emil Forslund
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.