Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add saveWithReferenceTo[Field] DSL support for linking using EntityManager.getReference [DATAJPA-422] #829

Closed
spring-projects-issues opened this issue Oct 31, 2013 · 1 comment
Assignees
Labels
status: declined type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Oct 31, 2013

Neale Upstone opened DATAJPA-422 and commented

Instead of exposing EntityManager.getReference() as suggested in DATAJPA-83, we could provide DSL save() implementations that support saveWithReferenceTo[fieldName](entity, referenceId).

For example:

class Foo {
    private Bar bar;

    // etc
}

interface FooRepository extends CrudRepository<Foo, Long> {

    Foo saveWithReferenceToBar(Foo entity, Long barId);
}

My implementation to achieve this is at http://stackoverflow.com/questions/11880924/how-to-add-custom-method-to-spring-data-jpa/19710310#19710310


No further details from DATAJPA-422

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Oct 18, 2019

Jens Schauder commented

This is a rather special requirement and I don't think this would find the necessary amount of usage to make it worthwhile

@spring-projects-issues spring-projects-issues added status: declined type: enhancement labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants