Code Monkey home page Code Monkey logo

Comments (2)

spring-projects-issues avatar spring-projects-issues commented on May 2, 2024

Oliver Drotbohm commented

There's two major reasons we don't expose an delete(ID id) yet. The first one is that the EntityManager only exposes a remove(Object entity) int the first place so that it is rather simple to do that. The second point aligns to you're requirement of not loading the entity at all. To achieve that we'd have to trigger a JQPL query which - according to the spec - does not cause related entities to be updated or deleted. This would the create a delta in the semantics of delete(T entity) and delete(ID id) which is a bit inconvenient.

Having that said, I perfectly get your point of deleting an entity by id just from a convenience point of view. So I think we could add an delete(ID id) method that uses findOne(ID id) under the hood and would thus save you one call to the repository plus execute the operation in a single transaction then

from spring-data-commons.

spring-projects-issues avatar spring-projects-issues commented on May 2, 2024

Oliver Drotbohm commented

Added method to the interface as well as implementations for JPA and Mongo

from spring-data-commons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.