- create jmix 1.0.0 project (jdk 11.0.8)
- add new JPA Entity with Id type UUID (annotated @JmixGeneratedValue by default)
- Add mandatory String attribute
@JmixEntity
@Table(name = "TEST")
@Entity
public class Test {
@JmixGeneratedValue
@Column(name = "ID", nullable = false)
@Id
private UUID id;
@Column(name = "NAME", nullable = false)
@NotNull
private String name;
....
}
- Create Master-detail screen
- Start application and create entity - all works
- Generate onAfterInit event handler
@Subscribe
public void onAfterInit(AfterInitEvent event) {
Test test = new Test();
test.setName("test name");
dataManager.save(test);
}
- Open Master-detail screen: IllegalStateException: Generated ID is null in com.company.test3.entity.Test-null [new]