-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-9840 Allow custom key implementations for 2nd level cache regions #976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Wrt type safety: can I use Java 8 type annotations to do the compile type check? |
@sebersole @Sanne @alexsnaps @galderz Any feedback? |
I can't look at it today, will try to make some time tonight or tomorrow at
|
I don't know, @sebersole would be able to say. One alternative option for additions to EntityRegionAccessStrategy...etc could be:
By doing that, if the caller knows what the generated cache key or generated cache key is exactly, it doesn't need to do any casting. If it doesn't know, it can simply assign to object. As far as 2LC implementations is concerned, it would not change anything, we still treat keys as opaque, but maybe for the rest of Hibernate code base it helps? Otherwise, the rest looks fine to me. |
Hi Galder, So we'll stick simply with 'Object' as it seems it's a non-problem :) |
@Sanne Fine by me :) |
…us key implementations
* Replaced all CacheKey with Object * Because of statistics, added unwrap operation to all AccessStrategies ** This is to be reviewed yet, since I had to modify SessionFactoryImplementor interface
I have rebased the PR and added commit with checkstyle fixes (can be squashed too). |
merged! thanks a lot @rvansa |
This is a follow up to #974
Last commit replaced all CacheKey with Object. Because of statistics, added unwrap operation to all AccessStrategies - this is to be reviewed yet, since I had to modify SessionFactoryImplementor interface.