Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.h2.console.enabled=true
- spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- spring.datasource.driverClassName=org.h2.Driver
- spring.datasource.username=
- spring.datasource.password=
- spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
- spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true
- @Service
- public class MyService {
- @Resource
- private MyRepository repository;
- @PostConstruct
- public void init() {
- repository.save(new MyEntity(/* some data here */));
- // DEBUGGER here! At this point localhost:8082 hasn't got any of my tables
- repository.findAll(); // Not empty! It returns me my entites
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement