Skip to main content

Posts

Showing posts from January, 2016

Spring Data very simple example with Postgres

Hi Folks

Today it's again about server technologies and data persistence, but with spring-data project. This project aims to eliminate boilerplate code required to create the data tier, and not only that,

it also eliminate the code required by ORMs like hibernate to manage session and entity manager and everything we used to do to persist our data. enough talking.

technologies used :
a- spring data
b- spring mvc for simple rest api
c- hibernate as JPA provider
d- gradle for build management
e- ide of your preference, I used intellj in this one.
d- postgres as db


 1- Business as usual we need a simple project structure, I'll keep it simple but scalable :




spring-data-sample (contains gradle root stuff: build, settings)
|
------ bl : data and business tier, merged together as we don't have any code for data!
|
------ web : where we expose bl with rest apis

 2- setup the database, and by that you only need to install postgres and prepare the database, I created one call…