Skip to content

Commit f990df6

Browse files
yrodieremarko-bekhta
authored andcommitted
HSEARCH-3277 Avoid using @type annotations
They will be removed in Hibernate ORM 6.
1 parent a0248a2 commit f990df6

File tree

1 file changed

+2
-9
lines changed
  • integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/model

1 file changed

+2
-9
lines changed

integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/model/GenericPropertyIT.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import static org.hibernate.search.util.impl.integrationtest.mapper.orm.OrmUtils.with;
1010

11+
import java.io.Serializable;
1112
import java.util.ArrayList;
1213
import java.util.List;
1314
import jakarta.persistence.Basic;
@@ -118,25 +119,17 @@ public void setGenericProperty(GenericEntity<String> genericProperty) {
118119
}
119120

120121
@Entity(name = "generic")
121-
public abstract static class GenericEntity<T> {
122+
public abstract static class GenericEntity<T extends Serializable> {
122123

123124
@Id
124125
private Integer id;
125126

126127
@Basic
127128
@GenericField
128-
// Necessary for Hibernate ORM: even if we make T extend Serializable,
129-
// ORM doesn't take it into account for some reason.
130-
@SuppressWarnings("deprecation")
131-
@org.hibernate.annotations.Type(type = "serializable")
132129
private T content;
133130

134131
@Basic
135132
@GenericField
136-
// Necessary for Hibernate ORM: even if we make T extend Serializable,
137-
// ORM doesn't take it into account for some reason.
138-
@SuppressWarnings("deprecation")
139-
@org.hibernate.annotations.Type(type = "serializable")
140133
private T[] arrayContent;
141134

142135
@OneToMany(mappedBy = "genericProperty")

0 commit comments

Comments
 (0)