Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

This example demonstrates how to wire up ActiveJDBC with Spring Boot in replacement of Hibernate.

Notifications You must be signed in to change notification settings

kasramp/active-jdbc-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot ActiveJDBC example

This example demonstrates how to wire up ActiveJDBC with Spring Boot in replacement of Hibernate.

You can find the tutorial about this example at the below link:

https://geekyhacker.com/2019/05/15/how-to-use-activejdbc-with-spring-boot/

This example provides three controllers as follows:

  • User controller: supports CRUD operations for User resource.
  • Song controller: supports CRUD operations for Song resource.
  • Playlist controller: supports CRUD operations for Playlist resource.

How to run

First start the docker-compose.yml file by running:

$ docker-compose -f docker-compose.yml up -d 

To run create database run dbcreate profile as below:

$ ./mvnw clean compile -P dbcreate

That executes db-migrator:create goal.

And finally to run the application run:

$ ./mvnw clean compile -P developer

The developer profile also takes care of generating the instruments as well as updating the db schema by running db-migrator:migrate goal. So you don't need to worry about it.

Once everything is up and running open the browser and go to http://localhost:8080. You should see Swagger to interact with.

If you wish to change any database settings just edit database.properties file.

About

This example demonstrates how to wire up ActiveJDBC with Spring Boot in replacement of Hibernate.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published