问题描述
我使用Hibernate 4.2并构建时间字节码工具来解决出现在 你知道什么是区别: Hibernate字节码增强: 因为在休眠它是这样写的: 我可以解决我的问题通过使用字节码检测问题,但它不能通过使用字节码增强工作。你知道为什么吗 ? 也许,这个新功能还没有完全开发? 感谢您的帮助。 b $ b 答案是字节码增强的方式。让我们来看看在这两种情况下会发生什么 和 字节码增强:字节码增强可以在运行时或构建时(离线)执行。在运行时执行增强功能时,持久化类会在加载时得到增强。当离线执行增强时,类文件在后编译步骤中得到增强; 在大多数字节码增强的情况下,它们都是在编译后进行的。如果您的Hibernate字节码增强功能出现这种情况,那么是的,更改代码的明显选择是字节码检测。 I am using Hibernate 4.2 and build time bytecode instrumentation for solve the lazy issue that appears on a Do you know what is the difference between : Hibernate bytecode instrumentation : http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch20.html#performance-fetching-lazyproperties Hibernate bytecode enhancement : http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch20.html#bytecode-enhancement Because on the hibernate documentation, it is written : I can solve my issue by using bytecode instrumentation but it doesn't works by using bytecode enhancement. Do you know why ? Maybe, this new feature is not fully developped ? Thanks for your helps. The answer is the way byte code enhancement is done. Let's see what happen in both cases And Bytecode enhancement: Bytecode enhancement may be performed either at runtime or at build time (offline). When enhancement is performed at runtime, persistent classes are enhanced as they are loaded. When enhancement is performed offline, class files are enhanced during a post-compilation step; In most case of bytecode enhancement, they are done at post compilation. If this is the case with your Hibernate bytecode enhancement, then yes the obvious choice to change the code is the byte code instrumentation. 这篇关于休眠 - 字节码检测和字节码增强之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! @OneToOne
关系和 @Lob $中的惰性问题c $ c>()
Hibernate字节码工具:
@OneToOne
relation and @Lob
(https://developer.jboss.org/wiki/SomeExplanationsOnLazyLoadingone-to-one)