Override spring data save method

I have created a BaseRepository which extends CrudRepository and is tagged with @NoRepositoryBean. All my other repositories extend BaseRepository. How can I override the save method in my BaseRepository to have custom error messages? For example I ...
more »

2017-08-28 12:08 (1) Answers

spring-data-redis Jackson serialization

I'm attempting to use the Jackson serialization feature of spring-data-redis. I am building a ObjectMapper and using the GenericJackson2JsonRedisSerializer as the serializer for the redisTemplate: @Configuration public class SampleModule ...
more »

2017-03-01 22:03 (1) Answers

Spring Not sending all fields in JSON response

MY POJO: import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; import lombok.Data; @Entity @Table(name="user_linked_email") @IdClass(UserL...
more »

2017-01-20 07:01 (1) Answers

Use JsonParser again after deserialization

I'm trying to extend the Jackson default deserialization to assign a placeholder object to the fields of my domain object when they are set to null explicitly in the json. I'm using Spring Boot + Spring Data. I searched a lot for the best way to do i...
more »

2017-01-12 10:01 (1) Answers

Spring data rest sorting fields with underscores

We are using a very simple setup of @RepositoryRestResource on top of a PagingAndSortingRepository connected to a postgres database. Also we have configured spring.jackson.property-naming-strategy=SNAKE_CASE to return pretty json. It was all fine and...
more »

2016-11-22 16:11 (2) Answers

Using two datasources in Spring Boot

I'm using Spring Boot 1.3.3 in my project with one database, now i want to use two databases with the same schema but different connections. I want to use same repositories, entities and find the way to tell spring which datasource i want to use dep...
more »

2016-11-16 18:11 (1) Answers

Spring JPA repository transactionality

1 quick question on Spring JPA repositories transactionality. I have a service that is not marked as transactional and calls Spring JPA repository method userRegistrationRepository.deleteByEmail(email); And it is defined as @Repository public int...
more »

2016-10-03 10:10 (1) Answers

Jackson Infinite Recursion

I have read all solutions regarding this issue on stack overflow and other sites . All solutions lead me to use @JsonBackReference OR @JsonIdentityInfo . But for both solutions I got below exception : Infinite recursion (StackOverflowError) (throug...
more »

2016-08-19 15:08 (0) Answers

Avoid DBRefs loop in Spring Data MongoDB

How to avoid DBRefs loop in Spring Data MongoDB: public class A implements Serialisable { @DBRef(lazy = true) private B b; ... } public class B implements Serialisable { @DBRef(lazy = true) private A a; ... } When I'm tryi...
more »

2016-08-05 11:08 (0) Answers