General clean-up of Javadoc for `o.h.annotations` package

This commit is contained in:
Steve Ebersole 2022-01-23 12:43:02 -06:00
parent 8168b932be
commit 0426c152d0
13 changed files with 39 additions and 20 deletions

View File

@ -17,17 +17,18 @@ import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Maps a discriminated to-one style associations pointing to one of several entity types * Maps a discriminated to-one style association pointing to one of several entity types
* depending on a local discriminator, as opposed to discriminated inheritance where the * depending on a local discriminator, as opposed to discriminated inheritance where the
* discriminator is kept as part of the entity hierarchy (see {@link jakarta.persistence.Inheritance} * discriminator is kept as part of the entity hierarchy (see {@link jakarta.persistence.Inheritance}
* and {@link jakarta.persistence.InheritanceType#SINGLE_TABLE} for details about discriminated * and {@link jakarta.persistence.InheritanceType#SINGLE_TABLE} for details about discriminated
* inheritance mappings). * inheritance mappings).
* <p> * <p/>
* For example, if you consider an {@code Order} entity containing {@code Payment} information * For example, if you consider an {@code Order} entity containing {@code Payment} information
* where {@code Payment} might be of type {@code CashPayment} or {@code CreditCardPayment}, * where {@code Payment} might be of type {@code CashPayment} or {@code CreditCardPayment},
* the {@code @Any} approach would be to keep that discriminator and matching value on the * the {@code @Any} approach would be to keep that discriminator and matching value on the
* {@code Order} itself. Thought of another way, the "foreign key" is really made up of the * {@code Order} itself instead as part of the {@code Payment} class. Thought of another way,
* value and discriminator. * the "foreign key" is really made up of the value and discriminator. Note however that this
* composite foreign-key is a conceptual and cannot be phsical.
* <ul> * <ul>
* <li>Use {@link Column} or {@link Formula} to define the "column" to which the * <li>Use {@link Column} or {@link Formula} to define the "column" to which the
* discriminator is mapped. * discriminator is mapped.

View File

@ -19,11 +19,13 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Simplified form for describing the discriminator value mapping as a discrete * Simplified form for describing the discriminator value mapping as a discrete
* set. Follows the pattern of JPA's {@link DiscriminatorColumn#discriminatorType()}. * set. Follows the pattern of JPA's {@link DiscriminatorColumn#discriminatorType()}.
* * <p/>
* Can be used in conjunction with {@link JdbcType} or {@link JdbcTypeCode} to * Can be used in conjunction with {@link JdbcType} or {@link JdbcTypeCode} to
* further describe the underlying mapping. {@link JdbcType} or {@link JdbcTypeCode} * further describe the underlying mapping. {@link JdbcType} or {@link JdbcTypeCode}
* can also be used without AnyDiscriminator. * can also be used without AnyDiscriminator.
* *
* @see Any
*
* @since 6.0 * @since 6.0
*/ */
@java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE})

View File

@ -18,6 +18,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* Specifies the mapping for a single any-valued discriminator value * Specifies the mapping for a single any-valued discriminator value
* to the corresponding entity * to the corresponding entity
* *
* @see Any
* @see AnyDiscriminator
*
* @since 6.0 * @since 6.0
*/ */
@java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE})

View File

@ -18,17 +18,17 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Names a persistent property access strategy ({@link PropertyAccessStrategy}) to use. * Names a persistent property access strategy ({@link PropertyAccessStrategy}) to use.
* * <p/>
* Can be specified at either:<ul> * Can be specified at either:<ul>
* <li> * <li>
* <strong>TYPE</strong> level, which will act as naming the default accessor strategy for * <strong>TYPE</strong> level, which will act as the default accessor strategy for
* all attributes on the class which do not explicitly name an accessor strategy * all attributes on the class which do not explicitly name an accessor strategy
* </li> * </li>
* <li> * <li>
* <strong>METHOD/FIELD</strong> level, which will be in effect for just that attribute. * <strong>METHOD/FIELD</strong> level, which will be in effect for just that attribute.
* </li> * </li>
* </ul> * </ul>
* * <p/>
* Should only be used to name custom {@link PropertyAccessStrategy}. For * Should only be used to name custom {@link PropertyAccessStrategy}. For
* {@code property/field} access, the JPA {@link jakarta.persistence.Access} annotation should be preferred * {@code property/field} access, the JPA {@link jakarta.persistence.Access} annotation should be preferred
* using the appropriate {@link jakarta.persistence.AccessType}. However, if this annotation is used with * using the appropriate {@link jakarta.persistence.AccessType}. However, if this annotation is used with

View File

@ -8,6 +8,8 @@ package org.hibernate.annotations;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import org.hibernate.cfg.AvailableSettings;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.METHOD;
@ -16,10 +18,12 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Can be used to map a {@link java.util.List}-valued attribute using * Can be used to map a {@link java.util.List}-valued attribute using
* {@link org.hibernate.metamodel.CollectionClassification#BAG} semantics. * {@link org.hibernate.metamodel.CollectionClassification#BAG} semantics.
* * <p/>
* @apiNote Ignored if either {@link jakarta.persistence.OrderColumn} or * @apiNote Ignored if either {@link jakarta.persistence.OrderColumn} or
* {@link ListIndexBase} is used. * {@link ListIndexBase} is used.
* *
* @implSpec May also be specified SessionFactory-wide using {@value AvailableSettings#DEFAULT_LIST_SEMANTICS}
*
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE}) @java.lang.annotation.Target({METHOD, FIELD, ANNOTATION_TYPE})

View File

@ -16,7 +16,7 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Specifies a custom instantiator implementation * Specifies a custom instantiator for a specific embedded
*/ */
@Target( {TYPE, FIELD, METHOD, ANNOTATION_TYPE} ) @Target( {TYPE, FIELD, METHOD, ANNOTATION_TYPE} )
@Retention( RUNTIME ) @Retention( RUNTIME )

View File

@ -18,7 +18,10 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Registers a custom instantiator implementation * Registers a custom instantiator implementation to be used
* for all references to a particular {@link jakarta.persistence.Embeddable}.
* <p/>
* May be overridden for a specific embedded using {@link org.hibernate.annotations.EmbeddableInstantiator}
*/ */
@Target( {TYPE, ANNOTATION_TYPE, PACKAGE} ) @Target( {TYPE, ANNOTATION_TYPE, PACKAGE} )
@Retention( RUNTIME ) @Retention( RUNTIME )

View File

@ -15,6 +15,8 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Grouping of {@link EmbeddableInstantiatorRegistration}
*
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Target( {TYPE, ANNOTATION_TYPE, PACKAGE} ) @Target( {TYPE, ANNOTATION_TYPE, PACKAGE} )

View File

@ -16,7 +16,11 @@ import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME; import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Generator annotation describing any kind of Hibernate generator in a generic (de-typed) manner. * Generator annotation describing any kind of Hibernate generator in a
* generic (de-typed) manner.
* <p/>
* For a more type-safe way to specify generators in annotations, see
* {@link IdGeneratorType}
* *
* @author Emmanuel Bernard * @author Emmanuel Bernard
*/ */

View File

@ -19,18 +19,16 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Registers the BasicJavaType to use for the given {@link #javaType} * Registers the BasicJavaType to use for the given {@link #javaType}
* * <p/>
* Registrations applied to a package are processed before Hibernate begins to process * Registrations applied to a package are processed before Hibernate begins to process
* any attributes, etc. * any attributes, etc.
* * <p/>
* Registrations applied to a class are only applied once Hibernate begins to process * Registrations applied to a class are only applied once Hibernate begins to process
* that class; it will also affect all future processing. However, it will not change * that class; it will also affect all future processing. However, it will not change
* previous resolutions to use this newly registered one. Because of this randomness * previous resolutions to use this newly registered one. Because of this randomness
* it is recommended to only apply registrations to packages or to use a * it is recommended to only apply registrations to packages or to use a
* {@link org.hibernate.boot.model.TypeContributor}. * {@link org.hibernate.boot.model.TypeContributor}.
* *
* @see org.hibernate.boot.model.TypeContributor
*
* @since 6.0 * @since 6.0
*/ */
@java.lang.annotation.Target({PACKAGE, TYPE, ANNOTATION_TYPE}) @java.lang.annotation.Target({PACKAGE, TYPE, ANNOTATION_TYPE})

View File

@ -39,11 +39,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* value. * value.
* </li> * </li>
* </ul> * </ul>
* * <p/>
* This code is generally as one of the values defined in {@link java.sql.Types}, but are not * This code is generally as one of the values defined in {@link java.sql.Types}, but are not
* limited to these. The code is resolved against an internal registry of {@link JdbcType} * limited to these. The code is resolved against an internal registry of {@link JdbcType}
* references. See the user-guide for additional details. * references. See the user-guide for additional details.
* * <p/>
* See <a href="package-summary.html#basic-value-mapping"/> for high-level discussion * See <a href="package-summary.html#basic-value-mapping"/> for high-level discussion
* of basic value mapping. * of basic value mapping.
* *

View File

@ -19,10 +19,10 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
/** /**
* Describes a SqlTypeDescriptor to be added to the {@link JdbcTypeRegistry} * Describes a SqlTypeDescriptor to be added to the {@link JdbcTypeRegistry}
* * <p/>
* Registrations applied to a package are processed before Hibernate begins to process * Registrations applied to a package are processed before Hibernate begins to process
* any attributes, etc. * any attributes, etc.
* * <p/>
* Registrations applied to a class are only applied once Hibernate begins to process * Registrations applied to a class are only applied once Hibernate begins to process
* that class; it will also affect all future processing. However, it will not change * that class; it will also affect all future processing. However, it will not change
* previous resolutions to use this newly registered one. Because of this randomness * previous resolutions to use this newly registered one. Because of this randomness

View File

@ -761,6 +761,8 @@ public interface AvailableSettings {
* <li>the (case insensitive) name of a {@code CollectionClassification}, or * <li>the (case insensitive) name of a {@code CollectionClassification}, or
* <li>a {@link Class} representing either {@link java.util.List} or {@link java.util.Collection}. * <li>a {@link Class} representing either {@link java.util.List} or {@link java.util.Collection}.
* </ul> * </ul>
* <p/>
* Backwards compatibility can be achieved by specifying `hibernate.mapping.default_list_semantics=bag` e.g.
* *
* @see org.hibernate.jpa.spi.JpaCompliance#isJpaListComplianceEnabled() * @see org.hibernate.jpa.spi.JpaCompliance#isJpaListComplianceEnabled()
* *