From 2f1e85095c3da82e67fcce18af05e5c639c62158 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Tue, 8 Nov 2022 02:08:29 +0100 Subject: [PATCH] add link to EntityNameResolver in Interceptor javadoc also fix a typo and get rid of uses of and
--- .../main/java/org/hibernate/Interceptor.java | 10 +++-- .../hibernate/usertype/CompositeUserType.java | 37 ++++++++++--------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/Interceptor.java b/hibernate-core/src/main/java/org/hibernate/Interceptor.java index 55dbbf92bd..1c0a3bff30 100644 --- a/hibernate-core/src/main/java/org/hibernate/Interceptor.java +++ b/hibernate-core/src/main/java/org/hibernate/Interceptor.java @@ -15,7 +15,7 @@ import org.hibernate.type.Type; /** * Allows user code to inspect and/or change entity property values before they are - * written to the database, or after the are read from the database. + * written to the database, or after they are read from the database. *

* The {@link Session} may not be invoked from a callback (nor may a callback cause * a collection or proxy to be lazily initialized). @@ -184,8 +184,8 @@ public interface Interceptor { } /** - * Called before an object is saved. The interceptor may modify the state, which will be used for - * the SQL INSERT and propagated to the persistent object. + * Called before an object is saved. The interceptor may modify the {@code state}, which will be used for + * the SQL {@code INSERT} and propagated to the persistent object. * * @param entity The entity instance whose state is being inserted * @param id The identifier of the entity @@ -193,7 +193,7 @@ public interface Interceptor { * @param propertyNames The names of the entity properties. * @param types The types of the entity properties * - * @return true if the user modified the state in any way. + * @return {@code true} if the user modified the {@code state} in any way. * * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. */ @@ -450,6 +450,8 @@ public interface Interceptor { * @return the name of the entity * * @throws CallbackException Thrown if the interceptor encounters any problems handling the callback. + * + * @see EntityNameResolver */ default String getEntityName(Object object) throws CallbackException { return null; diff --git a/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java b/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java index 072be277a4..c78e11de50 100644 --- a/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java +++ b/hibernate-core/src/main/java/org/hibernate/usertype/CompositeUserType.java @@ -15,27 +15,28 @@ import org.hibernate.metamodel.spi.EmbeddableInstantiator; import org.hibernate.metamodel.spi.ValueAccess; /** - * A UserType that may be dereferenced in a query. + * A {@link UserType} that may be dereferenced in a query. + *

* This interface allows a custom type to define "properties". * These need not necessarily correspond to physical JavaBeans - * style properties.
- *
- * A CompositeUserType may be used in almost every way - * that a component may be used. It may even contain many-to-one - * associations.
- *
+ * style properties. + *

+ * A {@code CompositeUserType} may be used in almost every way + * that an {@linkplain jakarta.persistence.Embeddable embeddable} + * type may be used. It may even contain many-to-one associations. + *

* Implementors must be immutable and must declare a public - * default constructor.
- *
- * Unlike UserType, cacheability does not depend upon - * serializability. Instead, assemble() and - * disassemble provide conversion to/from a cacheable - * representation. - *
- * Properties are ordered by the order of their names - * i.e. they are alphabetically ordered, such that - * properties[i].name < properties[i + 1].name - * for all i >= 0. + * default constructor. + *

+ * Unlike {@code UserType}, cacheability does not depend upon + * serializability. Instead, {@link #assemble(Serializable, Object)} + * and {@link #disassemble(Object)} provide conversion to and + * from a cacheable representation. + *

+ * Properties are ordered by name, that is, they are sprted + * alphabetically such that + * {@code properties[i].name < properties[i+1].name} + * for all {@code i >= 0}. */ @Incubating public interface CompositeUserType extends EmbeddableInstantiator {