Skip to content

This project includes a demonstration of a Spring JPA project which utilizes Hibernate mappings, Spring JPA Repository with Service layer. The mappings are then tested in JUnit with the help of an H2 in memory database.

License

Notifications You must be signed in to change notification settings

mdbytes/SpringJpaEntityMappings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring JPA: Hibernate Mappings with JUnit Testing

This project includes a demonstration of a Spring JPA project which utilizes Hibernate mappings, Spring JPA Repository with Service layer. The mappings are then tested in JUnit with the help of an H2 in memory database.

There are some details related to the testing, the most impactful of which is the @DirtiesContext annotation on the test classes required to reset services after each test.

The simple database structure, with relationships, can be seen in the following Entity Diagram:

With results from the current JUnit tests:

Future updates to this repository will expand both relationships and testing.

About

This project includes a demonstration of a Spring JPA project which utilizes Hibernate mappings, Spring JPA Repository with Service layer. The mappings are then tested in JUnit with the help of an H2 in memory database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages