<How can the absence of `@OrderColumn` generate du...
# stackoverflow
r
How can the absence of
@OrderColumn
generate duplicate data when reading from database?
I have Spring Data Jpa application with PostgreSQL database. I have a fairly simple scenario: save an entity, including entities that have an @OneToMany relationship with it. That is, I do messageRepository.save(entity) (where save from org.springframework.data.repository.CrudRepository) and thus save both MessageEntity and list of DocumentEntity. I noticed a strange thing: if I remove the @OrderColumn(name = "number"), then when executing...