[hibernate-issues] [JIRA] (BVAL-753) @NotEmpty not working when updating a Set using the getter (empty Set gets persisted)

Melissa Koppeschaar (JIRA) jira at hibernate.atlassian.net
Tue Jun 16 13:11:27 EDT 2020


Melissa Koppeschaar ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e8224cc870bed0c17b3879c ) *created* an issue

Bean Validation ( https://hibernate.atlassian.net/browse/BVAL?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/BVAL-753?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 ) BVAL-753 ( https://hibernate.atlassian.net/browse/BVAL-753?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 ) @NotEmpty not working when updating a Set using the getter (empty Set gets persisted) ( https://hibernate.atlassian.net/browse/BVAL-753?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 )

Issue Type: Bug Assignee: Unassigned Created: 16/Jun/2020 10:11 AM Priority: Minor Reporter: Melissa Koppeschaar ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5e8224cc870bed0c17b3879c )

MapStruct updates a Set by using the getter if the Set is already containing objects. For some reason, the @NotEmpty annotation gets bypassed in this scenario (i.e., it is possible to persist an empty Set when using the getter even though the @NotEmpty annotation is used). This problem does not show when using the setter.

Here is the link to a small project I created to demonstrate the bug:
https://gitlab.com/melissa.koppeschaar/hibernate-bug-report

( https://hibernate.atlassian.net/browse/BVAL-753#add-comment?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/BVAL-753#add-comment?atlOrigin=eyJpIjoiMjk1MzMxZmFmNjZkNGM4OWI1ZGFiMWE0YmQyNzg3MjMiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100128- sha1:2f2218b )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200616/a1975ba4/attachment.html 


More information about the hibernate-issues mailing list