There is no example or some explanation but spring boot way do not work: Jmix always create foreign key to parent table where no data records.
For example next Spring Boot entities works: I can set any organization for user (small or big). Jmix with same JmixEntities produce foreignh key exception. How to do the same in Jmix ?
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Getter
@Setter
public class Organization {
@Id
@GeneratedValue
private Long id;
@Column
private String name;
}
@Entity
public class SmallOrganization extends Organization{
}
@Entity
public class BigOrganization extends Organization{
}
@Entity
@Getter
@Setter
public class User {
@Id
@GeneratedValue
private Long id;
@ManyToOne
private Organization organization;
}