spring-data

How to make Spring server to start even if database is down?

白昼怎懂夜的黑 提交于 2020-12-01 00:33:48
问题 I'm using a Spring Boot(1.4.7) & MyBatis. spring.main1.datasource.url=jdbc:mariadb://192.168.0.11:3306/testdb?useUnicode=true&characterEncoding=utf8&autoReconnect=true&socketTimeout=5000&connectTimeout=3000 spring.main1.datasource.username=username spring.main1.datasource.password=password spring.main1.datasource.driverClassName=org.mariadb.jdbc.Driver spring.main1.datasource.tomcat.test-on-borrow=true spring.main1.datasource.tomcat.test-while-idle=true spring.main1.datasource.tomcat

How to make Spring server to start even if database is down?

我的梦境 提交于 2020-12-01 00:33:06
问题 I'm using a Spring Boot(1.4.7) & MyBatis. spring.main1.datasource.url=jdbc:mariadb://192.168.0.11:3306/testdb?useUnicode=true&characterEncoding=utf8&autoReconnect=true&socketTimeout=5000&connectTimeout=3000 spring.main1.datasource.username=username spring.main1.datasource.password=password spring.main1.datasource.driverClassName=org.mariadb.jdbc.Driver spring.main1.datasource.tomcat.test-on-borrow=true spring.main1.datasource.tomcat.test-while-idle=true spring.main1.datasource.tomcat

Spring JpaRepostory delete vs deleteInBatch

左心房为你撑大大i 提交于 2020-11-30 08:22:47
问题 What is the difference between delete(...) and deleteInBatch(...) methods in JpaRepostory in Spring ? The second one "deletes items in one SQL statement", but what does it mean from the application/database perspective ? Why exists two different methods with the similar results and when it is better to use one or other ? EDIT: The same applies also for deleteAll() and deleteAllInBatch() ... 回答1: The delete method is going to delete your entity in one operation. The deleteInBatch is going to

Spring JpaRepostory delete vs deleteInBatch

我的梦境 提交于 2020-11-30 08:20:11
问题 What is the difference between delete(...) and deleteInBatch(...) methods in JpaRepostory in Spring ? The second one "deletes items in one SQL statement", but what does it mean from the application/database perspective ? Why exists two different methods with the similar results and when it is better to use one or other ? EDIT: The same applies also for deleteAll() and deleteAllInBatch() ... 回答1: The delete method is going to delete your entity in one operation. The deleteInBatch is going to

Spring-Data-JPA with QueryDslPredicateExecutor and Joining into a collection

狂风中的少年 提交于 2020-11-30 04:30:04
问题 Let's say I have a data model like this (pseudocode): @Entity Person { @OneToMany List<PersonAttribute> attributes; } @Entity PersonAttribute { @ManyToOne AttributeName attributeName; String attributeValue; } @Entity AttributeName { String name; } I have a Spring-Data-JPA repository defined such as: public interface PersonRepository extends PagingAndSortingRepository<Person, Long>, QueryDslPredicateExecutor<Person>{} I see in the QueryDSL documentation that there is a mechanism to Join from