I have two records in my ArrayList<Object>
but when I'm trying to insert these records in database, only the last record gets saved into DB.
I'm using Spring data JPA entityManager.merge()
method since I have custom sequenceGenerator to be used for Entities.
summaryList.stream().forEach{(summary -> entityManager.merge(summary)};
On debugging I get two records in summaryList but when I check my DB table, only one record gets inserted.