I have the class: I want to know if it’s possible to use a native query join in spring data JPA and if the result of query was correctly mapped into entities like the above example. Can someone show me a complete example to user this. I must to use a native query in my case and I am not
Tag: spring
How to set logging.path for spring-boot apps?
spring-boot provides several logging.* settings that can be applied in application.properties, like: logging.level.=DEBUG logging.file=myfile.log logging.path=d:/logs/ Problem: myfile.log is …
Creating Pagination in Spring Data JPA
I am trying to implement pagination feature in Spring Data JPA. I am referring this Blog My Controller contains following code : My DAO is following : I am able to show first 20 records, how do I show next 20??? Is there any other pagination example that I can refer?? Answer I’ve seen similar problem la…
Jackson is ignoring spring.jackson.properties in my spring boot application
Jackson is ignoring spring.jackson.property-naming-strategy=SNAKE_CASE. I am using springBootVersion 1.4.2.RELEASE. In my application.properties file, I have added spring.jackson.property-naming-strategy=SNAKE_CASE But Jackson is not honoring this property, and my REST response is still camelCase. Interesting…
What is the Compatible version of Spring-security with spring-4.3.0-release?
Which version of spring security is compatible with Spring-4.3.0-release. my jars are as follows spring-aop-4.3.0.RELEASE.jar spring-beans-4.3.0.RELEASE.jar spring-context-4.3.0.RELEASE.jar spring-context-support-4.3.0.RELEASE.jar spring-core-4.3.0.RELEASE.jar spring-expression-4.3.0.RELEASE.jar spring-jdbc-4…
Optional pagination with Spring
I am pretty new to java and spring. What I want to implement is api endpoint /tickets with pagination and sorting. I made it and it works. But also what I would like to do is to return plain list of all tickets if size and page are not specified in the query params, so in FE I can use
Why does MockMvc always return empty content()?
I’m trying to test my rest api with mockMvc. The test failed because of: From the output of print(), I can know the API actually returned the expected string “iPhone”. And I guess the empty “Actual” above is caused by empty “Body” below My questions are: Why MockHttpS…
Error creating bean with name ‘entityManagerFactory’ defined in class path resource : Invocation of init method failed
When I compile my spring project, I got the following error. Error creating bean with name ‘entityManagerFactory’ defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed I am using STS Eclipse and MySql D…
Spring-boot default profile for integration tests
Spring-boot utilizes Spring profiles which allows to have separate config for different environments. One way I use this feature is to configure the test database to be used by integration tests. I wonder, however: is it necessary to create my own profile ‘test’ and explicitly activate this profil…
Why do I always get Whitelabel Error Page with status “404” while running a simple Spring Boot Application
My Controller My JSP (welcome.jsp) inside /WEB-INF/jsp (parent folder is WebContent) My pom.xml My App Initializer I even added thymeleaf dependency to my pom. It still didn’t work. When ever I hit localhost:8080/hello or /indexPage or /indexPageWithModel it always says Whitelabel Error Page This applic…