No default identifier bridge implementation for EmbeddedId type

Hi all,
Let me show you my codes first.

Product.class

@DynamicUpdate
@Getter
@Entity
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PACKAGE)
@Indexed(index = "product")
public class Product extends AbstractAggregateRoot<Product> {

    @Valid
    @EmbeddedId
    @IndexedEmbedded
    private ProductKey productKey;
    .......

ProductKey.class

@Getter
@Embeddable
@EqualsAndHashCode
@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class ProductKey implements Serializable {

    @GenericField(name = "catalog_id")
    private Long catalogId;

    @NotEmpty(payload = ProductIdLengthException.class)
    @Size(min = 1, max = 100, payload = ProductIdLengthException.class)
    @FullTextField(name = "item_id")
    private String itemId;
    .........

when I ran this codes, I met the error
“HSEARCH700001: No default identifier bridge implementation for type ProductKey’. Use a custom bridge.”

How can I make correct bridge implementation?

Thank you.

Hi,

You will find all the information you need in the reference documentation, in particular in this section: Hibernate Search 6.1.5.Final: Reference Documentation

If anything is missing from the reference documentation, please mention it here, I’ll try to answer and I’ll update the documentation.

There are plans for built-in support for @EmbeddedId in Hibernate Search so you don’t have to define a custom bridge (HSEARCH-4355), but we’re not there yet: it will require more work.

1 Like

@yrodiere
Thank you very much~!

1 Like