Architecture: Services layer with Spring

In order to make the service layer and use the dependency injection we will take Spring.

Spring 2.5.6 is the OEPE default version supported.

First we will add the Spring Facet to our project. Right mouse button over the project > Properties… :

Add Spring Facet

After genertate the ORM classes. They will generate with contextual menu > Spring > Generate Spring ORM Classes …

Creating new ORM Services

You can see, about the JPA defined in our persistence package, it will create th access classes and services ones. I recommend you see the lebrijo.school.services and lebrijo.school.dao packages.

After we must clean this class of methods, the generator generates all possibilities (remove, persist, findById,…). For example, if one entity of our model is a view, we can destroy persist or remove methods.

Here I keep the zip eclipse project after these steps.

Leave a Reply

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