Hibernate 5 .hbm XML files for entity mapping and bytecode enhancement

Solution Verified - Updated -

Issue

  • With EAP 6 Hibernate 4 we use .hbm XML files for entity mapping and bytecode enhancement in the form of build-time instrumentation. The entity classes are instrumented using the ant task org.hibernate.tool.instrument.javassist.InstrumentTask
    • For EAP 7 Hibernate 5 I tried to use the ant task org.hibernate.tool.enhance.EnhancementTask for build-time instrumentation, but instrumentation does not work as there do not seem to be any changes applied to the bytecode. For each entity the ant task prints:
"[instrument] Unable to delete class file [(xyz).class]"
  • Can build-time instrumentation using ant be applied to .hbm XML mapped entities?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.0.6
    • Upgrading from EAP 6 to EAP 7.x
    • Upgrading from Hibernate 4 to Hibernate 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content