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

PERSIST MERGE cannot be used in @ManyToMany [DATAJPA-1684] #1982

Closed
spring-projects-issues opened this issue Feb 18, 2020 · 3 comments
Closed
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

ywuliu opened DATAJPA-1684 and commented

Column like:

@ManyToMany(fetch = FetchType.EAGER,
cascade = {
CascadeType.PERSIST,
CascadeType.MERGE
}
)
@JoinTable(name = "post_tags",
joinColumns = { @JoinColumn(name = "post_id") },
inverseJoinColumns = { @JoinColumn(name = "tag_id") })
private Set<Tag> tags = new HashSet<>();

 

 

Here, we have new tag and exist tag in tags, no matter what we specify cascade ( a: ALL; b: PERSIST, MERGE; c: PERSIST, d: MERGE) , we get error error anyway either when we create or update

It only work when we remove Cascade, then, we HAVE TO search in DB  and build new Tag in DB first. 

 


Affects: 2.2.4 (Moore SR4)

@spring-projects-issues
Copy link
Author

Jens Schauder commented

Please provide a reproducer, i.e. a tiny project reproducing the problem.

Please also include a full stack trace.

So far this looks more like a mapping error or a bug in the JPA implementation you use

@spring-projects-issues spring-projects-issues added status: waiting-for-feedback We need additional information before we can continue type: bug A general bug in: core Issues in core support labels Dec 30, 2020
@spring-projects-issues
Copy link
Author

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Jan 6, 2021
@spring-projects-issues
Copy link
Author

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue labels Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants