add link to EntityNameResolver in Interceptor javadoc

also fix a typo and get rid of uses of <tt> and <br>
This commit is contained in:
Gavin King 2022-11-08 02:08:29 +01:00
parent 450a159a8d
commit 2f1e85095c
2 changed files with 25 additions and 22 deletions

View File

@ -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.
* <p>
* 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 <tt>state</tt>, which will be used for
* the SQL <tt>INSERT</tt> 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 <tt>true</tt> if the user modified the <tt>state</tt> 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;

View File

@ -15,27 +15,28 @@ import org.hibernate.metamodel.spi.EmbeddableInstantiator;
import org.hibernate.metamodel.spi.ValueAccess;
/**
* A <tt>UserType</tt> that may be dereferenced in a query.
* A {@link UserType} that may be dereferenced in a query.
* <p>
* This interface allows a custom type to define "properties".
* These need not necessarily correspond to physical JavaBeans
* style properties.<br>
* <br>
* A <tt>CompositeUserType</tt> may be used in almost every way
* that a component may be used. It may even contain many-to-one
* associations.<br>
* <br>
* style properties.
* <p>
* 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.
* <p>
* Implementors must be immutable and must declare a public
* default constructor.<br>
* <br>
* Unlike <tt>UserType</tt>, cacheability does not depend upon
* serializability. Instead, <tt>assemble()</tt> and
* <tt>disassemble</tt> provide conversion to/from a cacheable
* representation.
* <br>
* Properties are ordered by the order of their names
* i.e. they are alphabetically ordered, such that
* <code>properties[i].name &lt; properties[i + 1].name</code>
* for all <code>i &gt;= 0</code>.
* default constructor.
* <p>
* 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.
* <p>
* 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<J> extends EmbeddableInstantiator {