Posts

Showing posts from April, 2018

Creation of Spring + Hibernate + Maven Application

Image
1. Create a Maven Project in eclipse. 2.In the pom.xml, add the dependencies for Spring artifacts( spring-context,   commons-logging ,  spring-core ), for Hibernate artifacts( hibernate-core ) and your database specific connector, for example for mysql( mysql-connector-java ). For all these artifacts, search on maven repository and copy the required version dependency and place them inside <dependencies> tag of pom.xml. 3. Create  a POJO Employee(a simple java class and name it Employee.java), define the properties in the class and provide getter and setter methods for the properties of Employee class. Employee.java public class Employee {         private  String  name ;         private int  id ;         public  String getName() {                return  name ;         }         public   void  setName(String  name ) {                this . name  =  name ;         }         public   int  getId() {                return  id ;