In my project I need to send letter to user email with confirmation link. My solution: Add string column “code” and boolean column “is_active” (with default value false) to user table. When user register, generate unique string key and save to database. Send to email link, for example …
Tag: spring
Spring web mvc example, boot, Error creating bean with name ‘jacksonObjectMapperBuilder’
I’m new to Spring and largely to Java beyond the language itself…minimal console apps, etc. I’m trying to get the Spring website example here (https://spring.io/guides/gs/serving-web-content/) to work and I’m trying to stick with the spring boot piece used in the example rather than ba…
Hibernate : self join confusion?
I have a category table.In which first 5 are main category and others are sub category. I need to fetch the sub categories of first 5 main category so i have found the sql query The query is joining the same table itself.and am getting the result given below Result How can i convert the SQL query to HQL and
Unable to local MySQL database with Spring app deployed through Tomcat
I’m trying to create a web application using Spring and Hibernate, deploying it through Tomcat 8. I’ve setup MySQL and Tomcat 8 locally on my machine, and am able to deploy the web application to it. …
Get Set value from Redis using RedisTemplate
I am able to retrieve values from Redis using Jedis: But when I am trying to use Spring’s RedisTemplate , I am not getting any data. My data is stored in Redis as a Set. Can someone please point out to me what am I missing? EDIT : My xml config for RedisTemplate. Answer In short You have to configure
How to load an external property file to Spring Boot in Wildfly
I wonder how can I load an external property of my application running inside Wildfly 9 as WAR, I tried to add a java parameter to Wildfly execution but it seems the application did not recognize the properties. Is there any way how Spring Boot could read the external property file? I am trying to load and ru…
How to send byte[] array in retrofit
How do you send byte[] array in retrofit call. I just need to send over byte[]. I get this exception when I have been trying to send a retrofit call. retrofit.RetrofitError: retrofit.converter.ConversionException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected a string but was…
object references an unsaved transient instance – save the transient instance before flushing: com.entity.Role
I’m getting object references an unsaved transient instance – save the transient instance before flushing: com.entity.Role exception while trying to insert some values in table using hibernate related dependencies in pom.xml are Role.java is User.java is I’m using repository as mentioned in …
Spring batch FileItemWriter not creating file at correct path
I have a spring batch service containing a FileItemReader,FileItemProcessor and FileItemWriter.When creating the FileItemWriter I have to set the Resource that will be my output file. I am running the batch service on websphere on a Linux machine.The problem is if I set the resource as new FileSystemResource(…
What does decoupling two classes at the interface level mean?
Lets say we have class A in package A and class B in package B . If object of class A has reference to class B, then the two classes are said to have coupling between them. To address the coupling, …