Skip to content

Commit 8952091

Browse files
committed
add two @Apinotes about the role of Type
1 parent 12b6206 commit 8952091

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

hibernate-core/src/main/java/org/hibernate/Interceptor.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
* However, JPA callbacks do not provide the ability to access the previous
4848
* value of an updated property in a {@code @PreUpdate} callback, and do not
4949
* provide a well-defined way to intercept changes to collections.
50+
* <p>
51+
* Note that this API exposes the interface {@link Type}, which in modern
52+
* versions of Hibernate is considered an SPI. This is unfortunate, and might
53+
* change in the future, but is bearable for now.
5054
*
5155
* @see SessionBuilder#interceptor(Interceptor)
5256
* @see SharedSessionBuilder#interceptor()

hibernate-core/src/main/java/org/hibernate/type/Type.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@
3232
* An implementation of this interface must certainly be thread-safe. Ideally, it should also be
3333
* immutable.
3434
*
35+
* @apiNote
36+
* This interface&mdash;which has existed since the very earliest days of Hibernate&mdash;used
37+
* to be an important API. In modern versions of Hibernate its role has evolved, and it is no
38+
* longer considered an API, though it's still a very important SPI. Application programs should
39+
* avoid direct use of this interface where possible. In many cases,
40+
* {@link org.hibernate.type.descriptor.java.JavaType} or
41+
* {@link org.hibernate.type.descriptor.jdbc.JdbcType} may be used instead.
42+
*
3543
* @author Gavin King
3644
* @author Steve Ebersole
3745
*/
38-
@Internal
3946
public interface Type extends Serializable {
4047
/**
4148
* Return true if the implementation is castable to {@link AssociationType}. This does not

0 commit comments

Comments
 (0)