spring-boot

Postgresql - IN clause optimization for more than 3000 values

江枫思渺然 提交于 2021-02-17 06:04:28
问题 I have an application where the user will be uploading an excel file(.xlsx or .csv) with more than 10,000 rows with a single column "partId" containing the values to look for in database I will be reading the excel values and store it in list object and pass the list as parameter to the Spring Boot JPA repository find method that builds IN clause query internally: // Read excel file stream = new ByteArrayInputStream(file.getBytes()); wb = WorkbookFactory.create(stream); org.apache.poi.ss

Why spring data mongo not returning the field having time?

筅森魡賤 提交于 2021-02-17 05:45:28
问题 I have a document in my collection like { "_id" : ObjectId("5e3aaa7cdadc161d9c3e8014"), "carrierType" : "AIR", "carrierCode" : "TK", "flightNo" : "2134", "depLocationCode" : "DEL", "arrLocationCode" : "LHR", "depCountryCode" : "DELHI", "arrCountryCode" : "LONDON", "scheduledDepDateTime" : ISODate("2020-02-05T00:30:00Z") } { "_id" : ObjectId("5e3aaacddadc161d9c3e8015"), "carrierType" : "AIR", "carrierCode" : "TK", "flightNo" : "2021", "depLocationCode" : "DEL", "arrLocationCode" : "LHR",

CRUD operations on Array objects nested within an Object in MongoDB Spring Boot

前提是你 提交于 2021-02-17 05:37:29
问题 I have a MongoDB object which was created using a Map<String, List>. I'm trying to add CRUD methods to EDIT and DELETE objects from the arrays within the object. This is how the JSON structure looks like: [ { "id": "1", "courses": { "Spring": [ { "subject": "Electrical Engineering", . . . "id": "123" } ], "Fall": [ { "subject": "Electrical Engineering", . . . "id": "456" }, { "subject": "Computer Science", . . . "id": "789" } ] } } ] I was trying to use pull() method to remove the object but

CRUD operations on Array objects nested within an Object in MongoDB Spring Boot

[亡魂溺海] 提交于 2021-02-17 05:37:25
问题 I have a MongoDB object which was created using a Map<String, List>. I'm trying to add CRUD methods to EDIT and DELETE objects from the arrays within the object. This is how the JSON structure looks like: [ { "id": "1", "courses": { "Spring": [ { "subject": "Electrical Engineering", . . . "id": "123" } ], "Fall": [ { "subject": "Electrical Engineering", . . . "id": "456" }, { "subject": "Computer Science", . . . "id": "789" } ] } } ] I was trying to use pull() method to remove the object but

After Spring Boot 2 upgade authorization server returns “At least one redirect_uri must be registered with the client.”

核能气质少年 提交于 2021-02-17 05:30:09
问题 I upgraded our authorization server from Spring Boot 1.5.13.RELEASE to 2.1.3.RELEASE, and now I can authenticate, but I can no longer access the site. Here is the resulting URL and error after the POST to /login. https://auth-service-test-examle.cfapps.io/oauth/authorize?client_id=proxy-service&redirect_uri=http://test.example.com/login&response_type=code&state=QihbF4 OAuth Error error="invalid_request", error_description="At least one redirect_uri must be registered with the client." To

Why are there multiple TCP connections to the server when I open one website page in my Chrome?

不羁岁月 提交于 2021-02-17 05:29:12
问题 The website is developed in SpringBoot and deployed in Linux server. When I open one website page in Chrome, and I open TCP Viewer, I see that there are multiple TCP connections from my computer to the server. They are using totally different ports. And I check the network tab in Chrome DevTool, I see there is Keep-Alive in the requst header. I guess it is using Http 1.1 and long connections. So this confused me. Since it is long connection, all the content should be through one TCP

JPA: Having lists on both ends without infinite loop

∥☆過路亽.° 提交于 2021-02-17 05:28:08
问题 I am trying to link two entities via Set properties like: Entity A: Set<Group> groups Entity B: Set<Filter> filters However, I keep getting errors like infinite recursions. What is the best way to do this with JPA? 回答1: It goes into infinite recursion because both your entities call each other and it will never stop. Try adding @JsonManagedReference(value = "group-filter") Set<Group> groups and @JsonBackReference(value = "user-card") Set<Filter> filters above both the sets in your entities.

Getting Access Token with Spring Cloud Gateway and Spring Security with Keycloak

回眸只為那壹抹淺笑 提交于 2021-02-17 05:17:48
问题 I am using Spring cloud Gateway with Spring security and Keycloak for Access management. I am having an issue getting the access token with spring cloud gateway as the token I am getting doesn't have all the parameters like what I get from the token endpoint in keycloak. When I hit the keycloak token endpoint with all the details: http://localhost:8080/auth/realms/myrealm/protocol/openid-connect/token { "exp": 1595310135, "iat": 1595309835, "jti": "0a78d67c-878c-468c-8d03-e003af0350c3", "iss"

how to run/turn off selective tests based on profiles in spring boot

痴心易碎 提交于 2021-02-17 05:16:12
问题 I have a spring-boot application for which I am writing IT tests. The data for the tests comes from application-dev.properties when I activate dev profile Here is what I have for tests: @RunWith(SpringRunner.class) @SpringBootTest @WebAppConfiguration public class ApplicationTests { @Autowired Environment env; @Test public void contextLoads() { System.out.println(Arrays.toString((env.getActiveProfiles()))); } } ServiceITTest public class ServiceITTest extends ApplicationTests { @value String

how to run/turn off selective tests based on profiles in spring boot

走远了吗. 提交于 2021-02-17 05:16:06
问题 I have a spring-boot application for which I am writing IT tests. The data for the tests comes from application-dev.properties when I activate dev profile Here is what I have for tests: @RunWith(SpringRunner.class) @SpringBootTest @WebAppConfiguration public class ApplicationTests { @Autowired Environment env; @Test public void contextLoads() { System.out.println(Arrays.toString((env.getActiveProfiles()))); } } ServiceITTest public class ServiceITTest extends ApplicationTests { @value String