What is equivalent for type annotation in hibernate?

I have below code added while using hibernate search 5 .
Now in hibernate search org.hibernate.annotations.Type' is deprecated

    @Id
    @Column(name = Team.ID_COL, length = 36)
    @Type(type = "uuid-char")
    @ApiModelProperty(hidden = true)
    private UUID teamId;

What would be the equivalent for type annotation in hibernate search 6?? In my case what is the replacement for @Type(type = "uuid-char") ?

2 Likes

This is not a Hibernate Search annotation, but a Hibernate ORM annotation.

Moving this topic to the appropriate category.

The replacement in Hibernate ORM 6 is to use the @JdbcTypeCode annotation:

    @Id
    @Column(name = Team.ID_COL)
    @JdbcTypeCode(java.sql.Types.VARCHAR)
    @ApiModelProperty(hidden = true)
    private UUID teamId;
2 Likes

Hi @beikov - I am using hibernate 5.6.0.Final jar in our project and we don’t see this @JdbcTypeCode annotation there

So why are you asking for the replacement in Hibernate 6 then? You should update to 5.6.6.Final which will un-deprecate the @Type annotation. In 6.0 the annotation was changed to only accept UserType class literals.

Apology for inconvenience. This question was originally created for hibernate search 6 . Thanks

Not sure what this question has to do with Hibernate Search 6 since this is an annotation from Hibernate ORM, but like I wrote, the deprecation was removed in newer versions of Hibernate ORM 5.6

Sorry It was my confusion . Initially I though this annotation is from Hibernate Search 6.
After upgrading to 5.6.6 type annotation got un-deprecated. I hope with 5.6.6 there should not be any impact on hibernate search 6.0