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

[2.7] Close #1806 - Have to the ability to dynamically set the Validation Group during a transaction #2010

Open
wants to merge 1 commit into
base: 2.7
Choose a base branch
from

Conversation

exabrial
Copy link

@exabrial exabrial commented Nov 28, 2023

Hello, this PR Close #1806 for the 2.7 branch. The goal here is to allow a user to specify a validation group that should be executed when persisting. I'm hoping to sort of model this how the schema-per-tenant properties work (Which is very handy btw).

I have a signed ECA, but this is my first PR for EclipseLink so I could use some feedback. If this gets merged, then I'll port the changes to the other branches seeing active development.

Thank you!

@exabrial exabrial changed the title Close #1806 - Have to the ability to dynamically set the Validation Group during a transaction [2.7] Close #1806 - Have to the ability to dynamically set the Validation Group during a transaction Nov 30, 2023
@exabrial
Copy link
Author

Hello Eclipselink team, hoping for comment and suggested improvements. Thank you

Copy link
Contributor

@rfelcman rfelcman left a comment

Choose a reason for hiding this comment

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

  1. For functional changes like this we expect some test (in this case integration test). Please check and maybe extend jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/beanvalidation/BeanValidationJunitTest.java
  2. Please ensure, that copyright year in the modified files is updated.

@@ -319,6 +319,21 @@ public class EntityManagerProperties {
* )
*/
public static final String COMPOSITE_UNIT_PROPERTIES = PersistenceUnitProperties.COMPOSITE_UNIT_PROPERTIES;

Copy link
Contributor

Choose a reason for hiding this comment

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

Are properties bellow limited to EntityManager only or should be defined in PersistenceUnit scope?
I think, that PersistenceUnit scope should be used. Please check e.g. how PU property is stored and handled
#1790 (foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/sessions/Project.java, jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/EntityManagerSetupImpl.java, foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/config/PersistenceUnitProperties.java)

Copy link
Author

Choose a reason for hiding this comment

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

I intended them to be Entity Manager Properties, since we could allow them to be changed in a transaction. I believe the PersistenceUnit already has support for this feature, but it can't be changed dynamically, hence the reason for this enhancement. I hope that makes sense! Please let me know if it doesn't or if my reasoning is not correct.

@exabrial
Copy link
Author

Thank you for the direction! I really appreciate it. We'll get to work on these things.

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.

None yet

2 participants