Hi, in my case I am trying to implement a problematic mapping for a entity. The entity has an an composite primary key annotated with @EmbeddedId.
Code:
...
@Entity(name = "a")
@Table(name = "a")
public class A implements java.io.Serializable {
...
@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name = "name_1", column = @Column(name = "name_1", nullable = false, length = 64)),
@AttributeOverride(name = "name_2", column = @Column(name = "name_2", nullable = false, length = 16)) })
public AId getId() {
return this.id;
...
}
I try the same code, but the code does not work:
Code:
mapping.entity(A.class).indexed().indexName("a")
.property("id", ElementType.METHOD).documentId().field().bridge(ABridge.class)
Exception occurred during event dispatching:
org.hibernate.HibernateException:
could not init listeners...
Caused by: org.hibernate.search.SearchException:
Unable to guess FieldBridge for id...
I need an advise to solve my problem. Thanks