是否有可能使@Formula注释延迟加载的? [英] Is it possible to make @Formula annotation lazily loaded?

查看:198
本文介绍了是否有可能使@Formula注释延迟加载的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 @Formula 注释用它获取计算性能。我需要的是,这些领域/干将被注解为 @Formula 标注应延迟加载。

I have used @Formula annotation to use it for getting calculated properties. What I need is that those fields/getters which is annotated with @Formula annotation should be lazily loaded.

这甚至可能如果又如何?

Is this even possible and if so how?

感谢

推荐答案

是的。只是注释字段通过的 @Formula 属性的getter Basic.html#获取%28%29相对=nofollow> @基本(取= FetchType.LAZY),并使用该<一个href=\"http://docs.jboss.org/hibernate/orm/3.6/javadocs/org/hibernate/tool/instrument/javassist/InstrumentTask.html\"相对=nofollow> Ant任务由Hibernate提供以做实体类的字节code仪器。否则,对于 @Formula 属性延迟加载忽略。

Yes . Just annotating the fields/getter of the @Formula property by @Basic(fetch=FetchType.LAZY) and use this ant task provided by hibernate to do the bytecode instrumentation for the entity class. Otherwise , LAZY loading for the @Formula property is silently ignored.

的<一个href=\"http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html/performance.html#performance-fetching-lazyproperties\"相对=nofollow>文档包含如何使用此ant任务做字节code仪表的信息。

The documentation contains the info on how to use this ant task to do bytecode instrumentation.

这篇关于是否有可能使@Formula注释延迟加载的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆