[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:
Duplicate
is duplicated by DATAJPA-1535 Simple Repository delete of unexistin... Closed
Last updater: Jens Schauder

 Description   

From SimpleJpaRepository

@Transactional
	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.



 Comments   
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 Tue Nov 19 15:11:10 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.