简体   繁体   English

HSEARCH700020:无法在路径 '.addresss 的类型'com.codedecode.demo.entity.Posting'上找到关联的反面<collection> '</collection>

[英]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;

}

地址.java 省份.java

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.

相关问题 错误:线程“ main”中的异常org.hibernate.MappingException:未知实体:com.hibernate.demo.model.Contact - Error: Exception in thread “main” org.hibernate.MappingException: Unknown entity: com.hibernate.demo.model.Contact Sprintboot 运行时错误:无法为方法公共抽象 com.example.demo.entity.Department 创建查询 - Sprintboot Runtime error : Failed to create query for method public abstract com.example.demo.entity.Department 考虑在你的配置中定义一个 'com.example.demo.Commands$DefaultIO' 类型的 bean - Consider defining a bean of type 'com.example.demo.Commands$DefaultIO' in your configuration Spring 引导基本应用程序:字段 NotesRepository 需要一个无法找到的“com.demo.NotesRepository”类型的 bean - Spring boot basic application: field NotesRepository required a bean of type 'com.demo.NotesRepository' that could not be found 如何修复此错误:无法写入 JSON:未能延迟初始化角色集合:com.cashregister.demo.model - How to fix this error: Could not write JSON: failed to lazily initialize a collection of role: com.cashregister.demo.model 无法将 Object 转换为实体类型 - Unable to cast the Object to Entity Type JPA:在数据库中保存后无法找到实体 - JPA : Unable to find entity after saving in DB 如何修复“没有可用的‘com.newmvc.demo.queue.NewSender’类型的合格bean” - how to fix "No qualifying bean of type 'com.newmvc.demo.queue.NewSender' available" 尝试保存数据时找不到实体.. - Unable find Entity .. while trying to save data 春季启动错误:无法加载类&#39;com.mysema.codegen.model.Type&#39;无法加载类 - Spring boot error: Unable to load class 'com.mysema.codegen.model.Type'Unable to load class
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM