[jbosstools-issues] [JBoss JIRA] (JBIDE-23149) Reverse engineering strategy cannot be set to custom class if generation target is Hibernate 5.x
Antal Varga (JIRA)
issues at jboss.org
Mon Sep 12 09:48:00 EDT 2016
Antal Varga created JBIDE-23149:
-----------------------------------
Summary: Reverse engineering strategy cannot be set to custom class if generation target is Hibernate 5.x
Key: JBIDE-23149
URL: https://issues.jboss.org/browse/JBIDE-23149
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: hibernate
Affects Versions: 4.4.0.Final
Reporter: Antal Varga
The reason for that is the change in ServiceImpl.java in org.jboss.tools.hibernate.runtime.v_5_0*.jar or later.
private Object newReverseEngineeringStrategy(String className, Object delegate) {...}
tries to load class using the class loader of the delegate object at first which is *org.hibernate.cfg.reveng.OverrideRepository* and resides in *hibernate-tools-x.yy.jar*.
The main problem is that while in case of the earlier Hibernate generation targets (e.g. 4.3) the reverse engineering strategy class loading was done by *org.hibernate.util.xpl.ReflectHelper* (and worked well), this option
happens only as a fallback case now *BUT this only happens if the constructor has not been found* (only NoSuchMethodException is caught).
Therefore a reverse engineering strategy can only be loaded if it is loaded by the classloader of the hibernate-tools-x.yy.jar or one of its parent loaders (OSGI can make the things more complicated).
*I think the solution would be to catch ClassNotFoundException as well and try to load reverse engineering class using ReflectHelper in this case.*
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jbosstools-issues
mailing list