[英]HSEARCH700020: Unable to find the inverse side of the association on type 'com.codedecode.demo.entity.Posting' at path '.addresss<collection>'
@Getter
@Setter
@NoArgsConstructor
@Indexed
@Entity
@Table(name = "Posting")
public class Posting implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "job_name")
@FullTextField()
private String jobName;
@Column(name = "position")
@FullTextField()
private String position;
@Column(name = "descriptions", length = 3000)
@FullTextField()
private String description;
@Column(name = "gender_requirement")
@FullTextField()
private String genderRequirement;
@Column(name = "job_requirement", length = 4000)
@FullTextField()
private String jobRequirement;
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinTable(name = "posting_address", joinColumns = @JoinColumn(name = "posting_id"), inverseJoinColumns = @JoinColumn(name = "address_id"))
@EqualsAndHashCode.Exclude
@ToString.Exclude
@JsonIgnore
@IndexedEmbedded
private Collection<Address> addresss;
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "user_id", referencedColumnName = "id")
@EqualsAndHashCode.Exclude
@ToString.Exclude
@NotNull
@JsonIgnore
private User user;
}
Hibernate ORM mapping: type 'com.codedecode.demo.entity.Posting': path '.addresss.province.name': failures: - HSEARCH700020: Unable to find the inverse side of the association on type 'com.codedecode.demo.entity.Posting' at path '.addresss'. Hibernate ORM 映射:类型“com.codedecode.demo.entity.Posting”:路径“.addresss.province.name”:失败:-HSEARCH700020:无法在类型“com.codedecode.demo”上找到关联的反面。 entity.Posting' 在路径 '.addresss'。 Hibernate Search needs this information in order to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified. Hibernate 搜索需要此信息,以便在修改“com.codedecode.demo.entity.Address”时重新索引“com.codedecode.demo.entity.Posting”。 You can solve this error by defining the inverse side of this association, either with annotations specific to your integration (@OneToMany(mappedBy =...) in Hibernate ORM) or with the Hibernate Search @AssociationInverseSide annotation.您可以通过定义此关联的反面来解决此错误,或者使用特定于您的集成的注释(Hibernate ORM 中的 @OneToMany(mappedBy =...))或使用 Hibernate 搜索 @AssociationInverseSide 注释。 Alternatively, if you do not need to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).或者,如果在修改 'com.codedecode.demo.entity.Address' 时不需要重新索引 'com.codedecode.demo.entity.Posting',则可以使用 @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) 禁用自动重新索引. path '.addresss.province': failures: - HSEARCH700020: Unable to find the inverse side of the association on type 'com.codedecode.demo.entity.Posting' at path '.addresss'.路径“.addresss.province”:失败:-HSEARCH700020:无法在路径“.addresss”中找到类型“com.codedecode.demo.entity.Posting”的关联的反面。 Hibernate Search needs this information in order to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified. Hibernate 搜索需要此信息,以便在修改“com.codedecode.demo.entity.Address”时重新索引“com.codedecode.demo.entity.Posting”。 You can solve this error by defining the inverse side of this association, either with annotations specific to your integration (@OneToMany(mappedBy =...) in Hibernate ORM) or with the Hibernate Search @AssociationInverseSide annotation.您可以通过定义此关联的反面来解决此错误,或者使用特定于您的集成的注释(Hibernate ORM 中的 @OneToMany(mappedBy =...))或使用 Hibernate 搜索 @AssociationInverseSide 注释。 Alternatively, if you do not need to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW).或者,如果在修改 'com.codedecode.demo.entity.Address' 时不需要重新索引 'com.codedecode.demo.entity.Posting',则可以使用 @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) 禁用自动重新索引.
I have an error我有一个错误
You also have an explanation, right there in the error message:您还有一个解释,就在错误消息中:
Hibernate Search needs this information in order to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified. Hibernate 搜索需要此信息,以便在修改“com.codedecode.demo.entity.Address”时重新索引“com.codedecode.demo.entity.Posting”。
And even two solutions:甚至有两种解决方案:
You can solve this error by defining the inverse side of this association, either with annotations specific to your integration (@OneToMany(mappedBy =...) in Hibernate ORM) or with the Hibernate Search @AssociationInverseSide annotation.您可以通过定义此关联的反面来解决此错误,或者使用特定于您的集成的注释(Hibernate ORM 中的 @OneToMany(mappedBy =...))或使用 Hibernate 搜索 @AssociationInverseSide 注释。
Alternatively, if you do not need to reindex 'com.codedecode.demo.entity.Posting' when 'com.codedecode.demo.entity.Address' is modified, you can disable automatic reindexing with @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)或者,如果在修改 'com.codedecode.demo.entity.Address' 时不需要重新索引 'com.codedecode.demo.entity.Posting',则可以使用 @IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW) 禁用自动重新索引
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.