I am currently coding a project, which requires me to map in between two entities: An account and a member. An account can have multiple members, whilst the member can only have one account. After I’ve finished coding the bidirectional way, everything was working and I got the response I wanted, which i…
Tag: spring-boot
Spring data jpa, how to filter and then sort results in this example?
I wrote a method, but as you can see – Category here is never used. Is to possible to find only Dishes where Category is same as defined and only after it – sort it by parameter using plain Spring data jpa? Or the only way to it is a custom query? Answer You could add a method like below
Spring Boot, Swagger and Authorisation
I have a Spring Boot API that uses Springdoc (Swagger). The API has security with “apiKey” and “code” fields being passed in the header. I am having difficulty configuring Swagger correctly to enable the Authentication function in the Swagger UI. This is the configuration: I know this …
Executing multiple java process on same VisualCode workspace
I have three springboot app in a visual Studio code workspace. All three configured to run on unique port.Is it possible to start all three springboot service on the same workspace? Earlier I have seen options where one can select the select the terminals for each process. Anysuggestion would be of great help…
Get multiple RequestParam of one variable
I’m trying to build a multifunctional search method using MongoTemplate, Query and Criteria. Here is my RequestMapping for variable search: I want to be able to search lastName with multiple request parameters. For example, I want to find everyone with lastname “Smith” and “JohnsonR…
How can I change di job CRON expression in order to run my Spring Batch job twice a week?
in a Spring Batch application on which I am working on I scheduled a job in this way: This works fine and my job is runned every Sunday (day 7) at 01:30 of the night. Ok it is fine but now my client ask me to run it twice in a week (same time but in two different days). Is
What do spring.mvc.view.prefix and spring.mvc.view.suffix have to be?
I created a Spring Boot demo app with Maven using Spring Initializr (that’s my almost the very first usage of Spring). It works, but for some reason doesn’t show any pages besides index.html. If I’m right, that’s because of configuration in application.properties, but I just don’…
How to handle 4xx(without retry) and 5xx (with retry) exceptions in camel
I’ve a camel route which makes API request, the external service may though 4xx or 5xx. I have written HttpOperationFailedException handler to handle all HTTP related exception and I’m retrying all the Http exceptions irrespective of whether its client side or server side exceptions. I would like …
Nested entities contains null after save
I have an entity with some nested entities like this with entity2 and entity3 like this: Both Entity2 and Entity3 have values stored in the database so when I’m doing an insert on MyEntity, I’m doing this: it works fine, the data are stored correctly in the DB with the correct foreign keys BUTR…
Access Denied – Unable to authenticate login – spring security
I work on simple authentication app using spring security & encounter by an access denied error. I must mention that registration works perfectly & I’ve already created 1 record with bcrypted password but on login I’m failed to understand that what did I miss. Grateful for the help User.ja…