fix some slightly misleading javadoc about the @Where annotation

This commit is contained in:
Gavin 2023-04-06 23:49:57 +02:00 committed by Gavin King
parent 176978cc42
commit 969eb9fb5a
2 changed files with 16 additions and 13 deletions

View File

@ -48,10 +48,11 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* List<Document> documents;
* </pre>
* <p>
* By default, {@code @Where} restrictions declared for an entity are
* By default, {@code @Where} restrictions declared for an entity are also
* applied when loading associations of that entity type. This behavior can
* be disabled using the setting {@value org.hibernate.cfg.AvailableSettings#USE_ENTITY_WHERE_CLAUSE_FOR_COLLECTIONS};
* note, however, that setting is disabled.
* be disabled using the setting
* {@value org.hibernate.cfg.AvailableSettings#USE_ENTITY_WHERE_CLAUSE_FOR_COLLECTIONS}.
* However, this setting is now deprecated.
* <p>
* Note that {@code @Where} restrictions are always applied and cannot be
* disabled. Nor may they be parameterized. They're therefore <em>much</em>

View File

@ -2029,18 +2029,20 @@ public interface AvailableSettings {
String CUSTOM_ENTITY_DIRTINESS_STRATEGY = "hibernate.entity_dirtiness_strategy";
/**
* The {@link org.hibernate.annotations.Where} annotation specifies a restriction
* on the table rows which are visible as entity class instances or collection
* elements.
* <p/>
* This setting controls whether the restriction applied to an entity should
* be applied to association fetches (one-to-one, many-to-one, one-to-many and many-to-many)
* targeting the entity.
* The {@link org.hibernate.annotations.Where @Where} annotation specifies a
* restriction on the table rows which are visible as entity class instances or
* collection elements.
* <p>
* This setting controls whether the restriction applied to an entity should be
* applied to association fetches (for one-to-one, many-to-one, one-to-many, and
* many-to-many associations) which target the entity.
*
* @apiNote The setting is very misnamed - it applies across all entity associations, not just collections.
* @apiNote The setting is very misnamed - it applies across all entity associations,
* not only to collections.
*
* @implSpec Enabled ({@code true}) by default, meaning the restriction is applied. When this setting
* is disabled ({@code false}), the restriction is not applied.
* @implSpec Enabled ({@code true}) by default, meaning the restriction is applied.
* When this setting is explicitly disabled ({@code false}), the restriction
* is not applied.
*
* @deprecated Originally added as a backwards compatibility flag
*/