[DATAJPA-1324] delete method CrudRepository when @Version column is null insert new data Created: 13/Apr/18  Updated: 22/May/19  Resolved: 12/Dec/18

Status: Closed
Project: Spring Data JPA
Component/s: Core
Affects Version/s: 1.11.11 (Ingalls SR11)
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: soner sivri Assignee: Jens Schauder
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
is duplicated by DATAJPA-1535 Simple Repository delete of unexistin... Closed
Last updater: Jens Schauder


From SimpleJpaRepository

	public void delete(T entity) {

		Assert.notNull(entity, "The entity must not be null!");
		em.remove(em.contains(entity) ? entity : em.merge(entity));

The em.merge causes an insert.

Comment by Jens Schauder [ 23/May/18 ]

If I understand you correctly, you try to delete an entity that isn't saved yet and you end up with an insert due to the merge in the SimpleJpaRepository. Is that correct?

Assuming this is correct: Why would you do that?

Comment by Jens Schauder [ 22/May/19 ]

Batch closing resolved issue without a fix version and a resolution indicating that there is nothing to release (Won't fix, Invalid ...)

Generated at Fri Jul 10 07:04:12 UTC 2020 using Jira 8.5.4#805004-sha1:0444eab799707f9ad7b248d69f858774aadfd250.