在使用依赖项构建我的 Maven 项目时,我不断收到此错误:
Exception Description: The target entity of the relationship attribute
[template] on the class [class pt.ipleiria.dae.entities.Configuration]
cannot be determined. When not using generics, ensure the target entity is
defined on the relationship mapping.
我有这两个实体,代码如下: 配置:
@ManyToMany(mappedBy="configurations")
private Template template;
private String name;
private ConfigurationState state;
private String version;
private String description;
private List<Module> modules;
private List<Resource> resources;
private List<String> parameters;
private List<String> extensions;
private String contrato;
模板(关系的所有者):
@ManyToMany
@JoinTable(name="TEMPLATE_CONFIGURATIONS",
joinColumns=
@JoinColumn(name="ID", referencedColumnName="ID"),
inverseJoinColumns=
@JoinColumn(name="ID", referencedColumnName="ID")
)
private List<Configuration> configurations;
我想建立多对多的关系,因为“模板”包含多个“配置”,而“配置”可以在多个“模板”(配置)中。