Skip to content

Commit 110596a

Browse files
committed
deprecate two unused types in the cache SPI + add javadoc
also correct some errors in the names of types - this is why it's better to use @link!!
1 parent cf9578a commit 110596a

17 files changed

+141
-86
lines changed

hibernate-core/src/main/java/org/hibernate/cache/cfg/spi/DomainDataRegionBuildingContext.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919
public interface DomainDataRegionBuildingContext {
2020
/**
21-
* The CacheKeyFactory explicitly specified as part of the
22-
* bootstrap by the user, by some "container", etc.
21+
* The {@link CacheKeysFactory} explicitly specified as part of
22+
* the bootstrap by the user, by some "container", etc.
2323
*
24-
* If this method returns a non-null value, it is expected
25-
* that RegionFactory implementors will use to be its
26-
* CacheKeyFactory and return it when asked later.
24+
* If this method returns a non-null value, it is expected that
25+
* {@link RegionFactory} implementors will use to be its
26+
* {@link CacheKeysFactory} and return it when asked later.
2727
*/
2828
CacheKeysFactory getEnforcedCacheKeysFactory();
2929

hibernate-core/src/main/java/org/hibernate/cache/spi/CacheKeysFactory.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import org.hibernate.persister.entity.EntityPersister;
1313

1414
/**
15+
* A factory for keys into the second-level cache.
16+
*
1517
* @author Radim Vansa <[email protected]>
1618
*/
1719
public interface CacheKeysFactory {

hibernate-core/src/main/java/org/hibernate/cache/spi/CacheTransactionSynchronization.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* Defines a context object that a {@link RegionFactory} is asked to create
1111
* ({@link RegionFactory#createTransactionContext}}) when a Hibernate Session
12-
* is created. It's lifecycle is that of the Session. It receives
12+
* is created. Its lifecycle is that of the Session. It receives
1313
* "transactional event callbacks" around joining and completing resource
1414
* transactions.
1515
*
@@ -26,13 +26,13 @@
2626
* instead. Native transactional implementation may provide looser semantics
2727
* and 2LC implementation has to adapt to these.
2828
*
29-
* @implNote Even though a JTA transaction may involve more than one Session
30-
* the CacheTransactionContext is specific to each Session since the distinction
31-
* is generally unimportant. However, a provider is free to attempt to scope
32-
* these CacheTransactionContext instances in such a way that they may be
33-
* associated with more than one Session at a time. This SPI is designed
34-
* to not require this of the caching impl, but it certainly allows the
35-
* provider to do it
29+
* @implNote Even though a JTA transaction may involve more than one session,
30+
* the {@code CacheTransactionSynchronization} is specific to each session since
31+
* the distinction is generally unimportant. However, a provider is free to
32+
* attempt to scope these {@code CacheTransactionSynchronization} instances in
33+
* such a way that they may be associated with more than one session at a time.
34+
* This SPI is designed to not require this of the caching impl, but it certainly
35+
* allows the provider to do it.
3636
*
3737
* @author Steve Ebersole
3838
* @author Radim Vansa

hibernate-core/src/main/java/org/hibernate/cache/spi/DirectAccessRegion.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
import org.hibernate.engine.spi.SharedSessionContractImplementor;
1010

1111
/**
12-
* Specialized Region whose data is accessed directly (not requiring key/item wrapping).
12+
* Specialized {@link Region} whose data is accessed directly,
13+
* without the need for key/item wrapping.
1314
*
14-
* Does not define a "remove" operation because Hibernate's query and timestamps caches
15-
* only ever "get" and "put"
15+
* Does not define a "remove" operation because Hibernate's
16+
* query and timestamps caches only ever "get" and "put".
1617
*
1718
* @author Steve Ebersole
1819
*/

hibernate-core/src/main/java/org/hibernate/cache/spi/DomainDataRegion.java

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,58 @@
1212
import org.hibernate.metamodel.model.domain.NavigableRole;
1313

1414
/**
15-
* A Region for cacheable domain data - entity, collection, natural-id.
16-
*
17-
* Generally speaking, this type of data has:
18-
*
19-
* * specific key and value wrapping that needs to be applied
20-
* * specific access patterns ({@link EntityDataAccess}, etc),
21-
* including some form of locking
15+
* A {@linkplain Region second-level cache region} that holds cacheable
16+
* domain data:
17+
* <ul>
18+
* <li>the destructured state of entity instances and collections, and
19+
* <li>mappings from natural id to primary key.
20+
*</ul>
21+
* This type of data has:
22+
* <ul>
23+
* <li>key and value wrapping that should to be applied, and
24+
* <li>defined policies for managing concurrent data access, possibly
25+
* including some form of locking.
26+
* </ul>
27+
* These behaviors are defined by an instance of {@link EntityDataAccess},
28+
* {@link CollectionDataAccess}, or {@link NaturalIdDataAccess}).
2229
*
2330
* @author Steve Ebersole
2431
*/
2532
public interface DomainDataRegion extends Region {
2633
/**
27-
* Build a EntityRegionAccess instance representing access to entity data
28-
* stored in this cache region using the given AccessType.
34+
* Build a {@link EntityDataAccess} instance representing access to
35+
* destructured entity data stored in this cache region.
2936
*
3037
* @apiNote Calling this method is illegal if the given entity is
31-
* not cached
38+
* not cacheable
3239
*
33-
* @param rootEntityRole The root entity name for the hierarchy whose data
34-
* we want to access
40+
* @param rootEntityRole The root entity name for the hierarchy whose
41+
* data we want to access
3542
*
3643
* @throws org.hibernate.cache.CacheException If the provider cannot provide the requested access
3744
*/
3845
EntityDataAccess getEntityDataAccess(NavigableRole rootEntityRole);
3946

4047
/**
41-
* Build a NaturalIdRegionAccess instance representing access to natural-id
42-
* data stored in this cache region using the given AccessType.
48+
* Build a {@link NaturalIdDataAccess} instance representing access to
49+
* natural id mappings stored in this cache region.
4350
*
44-
* @apiNote Calling this method is illegal if the given entity is
45-
* not cached
51+
* @apiNote Calling this method is illegal if the given natural id is
52+
* not cacheable
4653
*
4754
* @param rootEntityRole The NavigableRole of the root entity whose
48-
* natural-id data we want to access
55+
* natural id data we want to access
4956
*
5057
* @throws org.hibernate.cache.CacheException If the provider cannot provide the requested access
5158
*/
5259
NaturalIdDataAccess getNaturalIdDataAccess(NavigableRole rootEntityRole);
5360

5461
/**
55-
* Build a CollectionRegionAccess instance representing access to collection
56-
* data stored in this cache region using the given AccessType.
62+
* Build a {@link CollectionDataAccess} instance representing access to
63+
* destructured collection data stored in this cache region.
5764
*
58-
* @apiNote Calling this method is illegal if the given entity is
59-
* not cached
65+
* @apiNote Calling this method is illegal if the given collection is
66+
* not cacheable
6067
*
6168
* @param collectionRole The NavigableRole of the collection whose data
6269
* we want to access

hibernate-core/src/main/java/org/hibernate/cache/spi/ExtendedStatisticsSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
package org.hibernate.cache.spi;
88

99
/**
10-
* Optional Region contract defining support for extra statistic information
10+
* Optional contract for a {@link Region} defining support for extra statistic information.
1111
*
1212
* @author Steve Ebersole
1313
*/

hibernate-core/src/main/java/org/hibernate/cache/spi/FilterKey.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@
88

99
import java.io.Serializable;
1010
import java.util.HashMap;
11-
import java.util.HashSet;
1211
import java.util.Map;
13-
import java.util.Set;
1412

15-
import org.hibernate.Filter;
13+
import org.hibernate.Remove;
1614
import org.hibernate.engine.spi.TypedValue;
17-
import org.hibernate.internal.FilterImpl;
1815
import org.hibernate.type.Type;
1916

2017
/**
2118
* Allows cached queries to be keyed by enabled filters.
2219
*
2320
* @author Gavin King
21+
*
22+
* @deprecated this class is no longer used
2423
*/
24+
@Deprecated(since = "6.2") @Remove
2525
public final class FilterKey implements Serializable {
2626
private final String filterName;
2727
private final Map<String,TypedValue> filterParameters = new HashMap<>();

hibernate-core/src/main/java/org/hibernate/cache/spi/QueryKey.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import org.hibernate.query.spi.QueryParameterBindings;
1717

1818
/**
19-
* A key that identifies a particular query with bound parameter values. This is the object Hibernate uses
20-
* as its key into its query cache.
19+
* A key that identifies a particular query with bound parameter values.
20+
* This is the object Hibernate uses as a key into its query cache.
2121
*
2222
* @author Gavin King
2323
* @author Steve Ebersole

hibernate-core/src/main/java/org/hibernate/cache/spi/QueryResultsCache.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
/**
1717
* Defines the responsibility for managing query result data caching
18-
* in regards to a specific region.
18+
* in a specific {@linkplain QueryResultsRegion query cache region}.
19+
* There may be multiple instances of {@code QueryResultsCache},
20+
* corresponding to second-level cache regions with distinct policies.
21+
* <p>
22+
* A {@code QueryResultsCache} must be used in conjunction with a
23+
* {@link TimestampsCache} which tracks invalidation of the query
24+
* spaces (tables) which affect the cached queries.
1925
*
2026
* @author Gavin King
2127
* @author Steve Ebersole

hibernate-core/src/main/java/org/hibernate/cache/spi/QueryResultsRegion.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
package org.hibernate.cache.spi;
88

99
/**
10-
* Defines the contract for a cache region which will specifically be used to
11-
* store query results.
10+
* Defines the contract for a cache region that stores query results.
1211
*
1312
* @author Steve Ebersole
1413
*/

0 commit comments

Comments
 (0)