jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
706 stars 124 forks source link

Cascade validation of related objects is not working #686

Closed sukhova closed 5 months ago

sukhova commented 2 years ago

Environment

Description of the bug or enhancement

1) Create a Customerentity. 2) Create a Shop entity, create One to Many association attribute with Customer. 3) Add annotations @Size(min=1) and @Valid as it described in documentation.

@OneToMany(mappedBy = "shop")
    @Size(min = 1)
    @Valid
    private List<Customer> customers;

4) Create browser and editor screens for both entities, Shop editor screen should contain a table with Customers 5) Run the app and create Shop without customers

A.R. Nothing happens E.R. When an instance of Shop is validated, the list of customers will be checked for the fact that it contains at least one instance, and all instances of Shopin the list will also be validated.

See the test project: prjvalid.zip

gorbunkov commented 5 months ago

See also https://github.com/jmix-framework/jmix/issues/2364