I’m having some trouble with a particular query in my Spring Boot application. I’m using Spring’s built-in text encryption in order to encrypt text in my database I have an entity called BookRecord And a title encryption converter which looks like this I’m trying to search the database…
Tag: spring
How to change the log level for unit tests execution only in spring
I am having a question on how to change the log level for unit test execution only. Currently, my application is running (execution, not unit test) with the correct log level, everything is fine, very happy. However, each time I run unit tests, either on any local machine, either on our CI pipeline, we see th…
Hibernate Join between 2 tables with foreign key
Im trying to get a list with results from join with two tables, but always get error. What i want is List with person and job name Error Cannot invoke “org.hibernate.hql.internal.ast.tree.FromElement.setAllPropertyFetch(boolean)” because “fromElement” is null My tables Person int id te…
How to pass JSON Object and return Object from Spring rest controller
I have an entity class like below: Here is my rest controller: I have two questions: How can I send the report as well as Http Status back as a response? How to send the data to controller? I have created the following test case: When I run this the test case failed and I was able to pin point
How to return custom response in Spring with several attributes other than the List
I’m trying to get a custom response back from a spring rest controller back to the user, containing a list of all registered users and other keys such as sucess, etc. I tried the following approach but the Json array is completly escaped as a string… I get something like this and wanted something …
Why my trigger is not working with Hibernate?
I have a Java spring boot project and I use Hibernate in this project. I have a void deleteAll(List<Long> idList) method and its query is @Query(value = “DELETE c FROM Course c WHERE c.id in :idList”, nativeQuery = true). I want to use a trigger after every delete operation. I created a trig…
Java find Object which not containing in List of object
I wondering is there any way to filter object array with another object array. Its is to hard to explain but ill try my best this is my first entity this is second entity i have two list of this each entities Like this And I need to get MDynamicFieldTypes list which not containing in dynamicFields->type Li…
How can I generate Query in elastic search for multiple boolean queries
I want to generate query for multiple boolean operation dynamically in elasticsearch with spring framework. my data in elasticsearch is like I want to execute query for this boolean operation ((n=xyz) && (s=abc)) Answer To be able to query Array inner object you should map your processedData as a Nest…
Is it possible to edit values after Kafka consumer has been initiated? (from org.apache.kafka.clients.consumer)
I’d like to know if it’s possible to edit the values I gave while constructing a Kafka consumer later, namely: Is it possible to edit the values (specifically groupId) of my consumer cons after it has been generated? I would like to test for changes in the groupId Ex: I have looked at the docs but…
sending a list to the html page and then displaying it using thymeleaf gets parsing error
My flightList.html Controller Class for url mapping Flight class I am passing list to my flightList.html to display data in that list in a html table but when i load that page i get idk why it is unable to parse the data when I display the data in list to console (doing System.out.println) it works fine if an…