Skip to content

rd-1-2022/rpt-spring-data-jpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Spring Data JPA application

This project contains a test class that exercises the Spring Data JPA APIs for a Customer entity.

The class CustomerRepository extends the CrudRepository that provides basic create, retrieve, update and delete functionality for Customer entities.

The test class CustomerRepositoryTests exercises the repository by persisting a new Customer and then retrieving it.

All data is persisted in an in memory H2 database.

Customer customer = new Customer("first", "last");
entityManager.persist(customer);

List<Customer> findByLastName = customers.findByLastName(customer.getLastName());

If you run the application with the test-data profile, a few Customer entries will be created.

Running the code

To run the test and exercise the CustomerRepository functionality in a test

./mvnw clean package

About

Runnable Project Template for Spring Data JPA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages