Is it possible to create a @ManyToMany relationship with a @DbView entity?
I have a Table/Entity called CustomMaterial and I want to link it to a view from a separate database view within our company, located on another database and schema. Is this possible within jmix?
I keep getting an error:
Exception Description: [class at.magenta.tau.taup.custommaterials.entity.CustomMaterial] uses a non-entity [class at.magenta.tau.taup.custommaterials.entity.ErpVendor] as target entity in the relationship attribute [field erpVendors].
The ErpVendor entity has all the usual annotations:
@DbView
@JmixEntity
@Getter
@Store(name = EXT_STORE)
@Table(name = "VIEW_ERP_VENDOR", schema = EXT_SCHEMA)
@Entity(name = "cmat_ErpVendor")
public class ErpVendor {
...
}
The CustomMaterial table has this relationship setup:
@JoinTable(name = "CMAT_CUSTOM_MATERIAL_ERP_VENDOR_LINK", schema = CUSTOM_MATERIAL_SCHEMA,
joinColumns = @JoinColumn(name = "CUSTOM_MATERIAL_ID"),
inverseJoinColumns = @JoinColumn(name = "ERP_VENDOR_ID"))
@ManyToMany
private Set<ErpVendor> erpVendors;
Is there something special I need to do?