| But unless I am completely mistaken, that is something the old instrumentation code also did not do. Luis and I chatted about this earlier. What is being asked here is outside the intention of the current enhancer tasks. There is a pretty straightforward solution by leveraging the 2-phase "Metadata building process" I did for JPA in WildFly. The idea is to leverage org.hibernate.boot.model.process.spi.MetadataBuildingProcess#prepare and the org.hibernate.boot.model.process.spi.ManagedResources object it returns. The stated principle of this method is that up until this point Hibernate would still not have loaded the domain classes. So we'd get back this ManagedResources object and would leverage its state to build a list of Classes to be enhanced. Its more exhaustive than just looking for annotations. We'd still need some work to actually extract all the Class names from the XML bindings, but its not overly difficult (just tedious). These would the classes that we'd enhance. And that could work similarly for both runtime and buildtime enhancement. The reason that the 4.3 question is pertinent is because that decides whether this is a regression (and therefore handled as a bug) or a feature request. |