A view that relies on a DTO class in composition does not behave as it does in views generated from entities, while it works correctly in the Classic UI version.
I created an Entity Employee DTO that contains a collection of Addresses in composition, I generated the Address and Employee views, executed the project the composition does not work.
Doing the same thing with classic ui everything works correctly.
@JmixEntity
public class Address {
@JmixGeneratedValue
@JmixId
private UUID id;
@JmixProperty(mandatory = true)
@NotNull
private String streetName;
private String streetNumber;
public String getStreetNumber() {
return streetNumber;
}
public void setStreetNumber(String streetNumber) {
this.streetNumber = streetNumber;
}
public String getStreetName() {
return streetName;
}
public void setStreetName(String streetName) {
this.streetName = streetName;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
}
@JmixEntity
public class Employee {
@JmixGeneratedValue
@JmixId
private UUID id;
@InstanceName
@JmixProperty(mandatory = true)
@NotNull
private String name;
@JmixProperty(mandatory = true)
@NotNull
private String surname;
@Composition
private Collection<Address> addresses;
public Collection<Address> getAddresses() {
return addresses;
}
public void setAddresses(Collection<Address> addresses) {
this.addresses = addresses;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
}