JPA with OSGi DS example

1.4k views Asked by At

I am trying to figure out an example of JPA(containing an example of Student Entity, with name and class) using Eclipselink & Derby. I am able to do it in Java EE but I can't figure out a way to do it simply in OSGi using Declarative Services.

Can anyone share some info on any such examples which uses JPA with OSGi DS?

Some of the examples I have gone through are here, but these examples use getReference or getTracker however I don't want to use them.

Thank you.

2

There are 2 answers

2
Peter Kriens On BEST ANSWER

You can take a look at the OSGi enRoute project's tutorial. This is still work in progress but in phase 10 it actually uses JPA, transactions, etc.

https://github.com/osgi/osgi.enroute.blog

In the master branch there is a PDF that describes the tutorial in detail, step by step. Each step is a branch so you can look at the 10-jpa branch. It uses bndtools.

This is work in progress but it should give you a good idea.

0
evandor On

I also recommend the osgi.enroute.blog project mentioned by Peter; additionally I hope you might find my blog post about using flyway and OSGi useful. If you ignore the flyway parts, you will find an example project using eclipselink and osgi declarative services.