Skip to content

repository insert collection method call findOne of all items if @Id annotated field is valorized #3920

Open
@aprato-visual

Description

@aprato-visual

Java doc of repository insert collection method say :

"Inserts the given entities. Assumes the given entities to have not been persisted yet and thus will optimize the insert over a call to saveAll(Iterable). Prefer using saveAll(Iterable) to avoid the usage of storespecific API."

but if @id annotated fields of items in collection are pre valorized, repository first check all id and after this, save data but this degrade the performance of a code like this:
repository.deleteAll(); repository.insert(collection);
is this behavior intentional?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions