Skip to content

Commit cf72968

Browse files
committed
add two @Apinotes about the role of Type
also, Type is definitely not @internal
1 parent 12b6206 commit cf72968

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.util.Map;
1111

1212
import org.hibernate.HibernateException;
13-
import org.hibernate.Internal;
1413
import org.hibernate.MappingException;
1514
import org.hibernate.engine.spi.SessionFactoryImplementor;
1615
import org.hibernate.engine.spi.SharedSessionContractImplementor;
@@ -32,10 +31,17 @@
3231
* An implementation of this interface must certainly be thread-safe. Ideally, it should also be
3332
* immutable.
3433
*
34+
* @apiNote
35+
* This interface&mdash;which has existed since the very earliest days of Hibernate&mdash;used
36+
* to be an important API. In modern versions of Hibernate its role has evolved, and it is no
37+
* longer considered an API, though it's still a very important SPI. Application programs should
38+
* avoid direct use of this interface where possible. In many cases,
39+
* {@link org.hibernate.type.descriptor.java.JavaType} or
40+
* {@link org.hibernate.type.descriptor.jdbc.JdbcType} may be used instead.
41+
*
3542
* @author Gavin King
3643
* @author Steve Ebersole
3744
*/
38-
@Internal
3945
public interface Type extends Serializable {
4046
/**
4147
* Return true if the implementation is castable to {@link AssociationType}. This does not

0 commit comments

Comments
 (0)