Skip to content

Sample Spring-Hibernate core application without any xml configuration

Notifications You must be signed in to change notification settings

AayushyaVajpayee/Spring-Hibernate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A sample Spring-Hibernate application without any xml configuration using a gradle build

Usually any spring application which includes hibernate as an ORM includes lot of plumbing configuration in form of xml. In this application all configuration has been done in java files along with proper annotations.

What this application does?

An entity class com.sample.spring.entity.User has been created which stores all the users in database table(users). Two methods of com.sample.spring.dao.UserDaoUserService class are as following:

void add(User user) // adds a new user row in USERS table of database
List<User> listUsers() // fetches all the rows present in USERS table of database

how to run the application?

Configure the properties in /src/main/resources/db.properties according to your settings of mysql. After that from the home directory of the project you need to execute the following two commands in command prompt (if you don't have gradle configured follow this link gradle installation)

gradle build
gradle run

Built With

About

Sample Spring-Hibernate core application without any xml configuration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages