Skip to content

Conversation

@a-e-tsvetkov
Copy link
Contributor

@a-e-tsvetkov a-e-tsvetkov commented Oct 12, 2024

I have several entities with common super class SoftDeleteSupport marked with @MappedSuperclass annotation. It have boolean rmv; field.

Currently I have to put @SQLRestriction in each entity.

I propose to support @SQLRestriction on classes marked with @MappedSuperclass t reduce code duplication.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-18723

Copy link
Member

@gavinking gavinking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the requested feature.

*/
@Target({TYPE, METHOD, FIELD})
@Retention(RUNTIME)
@Inherited
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not yet convinced that we should support the requested feature.

But if we decided to, this isn't the right fix, since it implies inheritance even from things which aren't @MappedSuperclasses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I will fix implementation.

If I do so what will be the process of approving this feature? What is your reservations against it?

Copy link
Contributor Author

@a-e-tsvetkov a-e-tsvetkov Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gavinking
I found that similar annotation SoftDelete is supporting MappedSuperclass.

Will this convince you to accept my improvement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this convince you to accept my improvement?

I don't hate it. Let's see what others think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it certainly can't be merged in its current form because it breaks the overridability of @SQLRestriction, as I commented yesterday.

But if what you're saying is that this functionality is really not very important to you after all, then yes, please just close the PR.

@a-e-tsvetkov a-e-tsvetkov marked this pull request as draft October 12, 2024 09:34
@a-e-tsvetkov a-e-tsvetkov marked this pull request as ready for review October 12, 2024 10:13
Copy link
Member

@gavinking gavinking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQLRestriction is an overridable annotation, and this proposed implementation breaks that.

Comment on lines -1631 to +1630
final SQLRestriction restriction = getOverridableAnnotation( annotatedClass, SQLRestriction.class, context );
final SQLRestriction restriction = extractSQLRestriction( annotatedClass, context );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added this test: 78cd996 to demonstrate the problem with this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated your test.
Now it fails if @DialectOverride.SQLRestriction is ignored.

I will work on fixing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I solved that problem.

@a-e-tsvetkov a-e-tsvetkov force-pushed the feature/HHH-18723 branch 3 times, most recently from 0b49682 to 8673922 Compare December 5, 2024 17:04
@SvenBunge
Copy link

Looking for the same feature. IT seems this PR has been closed without merging it into main and without commenting the actual state. The Jira-Ticket is on review. Can somebody enlights me about the latest development?

See https://hibernate.atlassian.net/browse/HHH-18723

@beikov
Copy link
Member

beikov commented Feb 11, 2025

It just seems @a-e-tsvetkov stopped working on it. If you care about this, you can create a new PR.

@a-e-tsvetkov
Copy link
Contributor Author

a-e-tsvetkov commented Feb 12, 2025 via email

@gavinking
Copy link
Member

I closed PR after I was asked to do so.

FTR all I said was that it could not be merged "in its current form", because in the current implementation your change is breaking a different feature of @SQLRestriction.

I'm not completely sure what the second half of what I wrote above (on Nov 30) was in response to, since the comment I was replying to appears to have been deleted (I suppose you deleted it). My best reconstruction of events is that I guess you must have implied in the deleted comment that you weren't prepared to make the requested changes in order to not break existing functionality.

@a-e-tsvetkov
Copy link
Contributor Author

a-e-tsvetkov commented Feb 13, 2025 via email

@beikov
Copy link
Member

beikov commented Feb 13, 2025

There is no "timeframe" that we can guarantee. We all just try our best to not have you wait for too long, but as you can imagine, things might get in between.

If you're willing to address issues that we point out, please reopen the PR.

@a-e-tsvetkov
Copy link
Contributor Author

I reopened the PR.
Let me know if you find any other problems with it.

@a-e-tsvetkov
Copy link
Contributor Author

Apparently I can't reopen it because I force-pushed in the branch.
Should I create new one or there is a way to update this PR?

@beikov
Copy link
Member

beikov commented Feb 13, 2025

Please create a new PR then.

@a-e-tsvetkov
Copy link
Contributor Author

Here is new PR #9744

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants