如何在 Seam 引擎发出的调用上设置查询缓存
@In
Identity identity;
Boolean newValue = identity.hasPermission(target, action);
对上述方法的任何调用也会执行“从 Role r 选择角色”调用,该调用是从底层 Seam 引擎调用的。如何将此调用的查询缓存设置为查询提示(例如 org.hibernate.cacheable 标志),以便它不会再次被调用。
注意:角色信息永远不会改变,因此我认为这是不必要的 sql 调用。
@In
Identity identity;
Boolean newValue = identity.hasPermission(target, action);
Any call to the above method also does a "select role from Role r" call, which is called from the underlying seam engine. How do I set the query cache for this call as a query hint (e.g. org.hibernate.cacheable flag) so that it doesn't get called again.
Note: Role information is never bound to change, hence I view this as a unnecessary sql call.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有处于休眠状态,但这个问题仍然没有答案:出于多种原因,我们扩展了接缝的标准 Identity 类。您可能还想扩展它以帮助您缓存结果。
由于此缓存是会话范围的,因此它可能有一个好处,即当用户再次登录/注销时它将重新加载 - 但这取决于您的要求。
此致,
亚历山大.
I am not in hibernate, but as this question is still unanswered: we extended the standard Identity class of seam for several reasons. You might want to extend it as well to help you caching the results.
As this cache is session scoped, it will have the possible benefit that it will be reloaded when the user logs on/off again - but this depends on your requirements.
Best regards,
Alexander.