我有两个表(外部的,所以我不能修改它)。表仅具有逻辑关系(一个具有其他参考 ID),没有 @OneTo* 注释。
Hibernate Search 是否可以索引此相关对象?
代码示例:
@Entity
@Indexed
@Table(name = "E1")
public class E1 implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private Long id;
@Column(name = "NAME", length = 32, nullable = false)
private String name;
@Column(name = "E2_FK", nullable = false)
@IndexedEmbedded // ????
private Long e2Id;
}
@Entity
@Table(name = "E2")
public class E2 implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID")
private Long id;
@Column(name = "DESCRIPTION", length = 4000, nullable = false)
@Field
private String description;
}