Spring Data JPA, Hibernate: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “toy_paths_pkey”
I have two entities: Dog and Toy. A Toy is associated with a String path. toys_paths table: dog_id toy_path toy_id The (dog_id and toy_id) should be a unique pair. Inside Dog entities it’s stored as Map<Toy, String>: @Entity(name = "dogs") public class Dog { @Id @SequenceGenerator(name = "dog_sequence", sequenceName = "dog_sequence", allocationSize = 1) @GeneratedValue(strategy