cuba icon indicating copy to clipboard operation
cuba copied to clipboard

Cascade validation of related objects is not working

Open natfirst opened this issue 5 years ago • 2 comments

Environment

  • Platform version: 7.2.10
  • Forum issue https://www.cuba-platform.ru/discuss/t/kaskadnaya-validacziya-kolekczii/5233

Description of the bug or enhancement

  1. Create a Customer entity
  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;
  1. Create browser and editor screens for both entities, Shop editor screen should contain a table with Customers
  2. 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 Product in the list will also be validated

natfirst avatar Dec 21 '20 16:12 natfirst

Is it a regression? What is the version of CUBA where it works?

andreysubbotin avatar Dec 23 '20 13:12 andreysubbotin

Does not work in any version of platform 7.2 Label changed for bug

natfirst avatar Jan 11 '21 13:01 natfirst