/osgi.enroute.examples.jdbc

A project used to develop the way OSGi enRoute could use persistence

Primary LanguageJavaApache License 2.0Apache-2.0

OSGi enRoute JDBC Example

This repository represents a JDBC example workspace for bndtools, it demonstrates on how to use JDBC with Aries Tx-Control. The application uses the PAX-JDBC bundle for defining the datasources.

If you want to get started with enRoute, then follow the steps in the quick-start guide.

Example

This example builds simple address book application which stores a Person with one or more email addresses

Database Entities

The example uses two DB entities Person and Example as shown in the diagram below

enRoute JDBC Example ERD

Application

The application is available over the url http://localhost:8080/osgi.enroute.examples.jdbc.addressbook/index.html

The following table shows the list of resources available to be consumed,

HTTP Method URL Use Transaction
GET http://localhost:8080/rest/person/{personId} Get person by personId Not Required, Supports
GET http://localhost:8080/rest/person Get all persons from the database Not Required, Supports
PUT http://localhost:8080/rest/person Save person along with addresses Required
POST http://localhost:8080/rest/person Update person along with addresses Required
DELETE http://localhost:8080/rest/person/{personId} Delete person by personId Required

The example application and datasource is configured using the configuration.json