Author: vyemialyanchyk
Date: 2010-04-09 10:01:58 -0400 (Fri, 09 Apr 2010)
New Revision: 21399
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateProxyHelperStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - create/invoke by string name - for all
classes 2
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateProxyHelperStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateProxyHelperStub.java 2010-04-09
13:57:31 UTC (rev 21398)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateProxyHelperStub.java 2010-04-09
14:01:58 UTC (rev 21399)
@@ -6,6 +6,6 @@
public static final String CL = "org.hibernate.proxy.HibernateProxyHelper";
//$NON-NLS-1$
public static Class<?> getClassWithoutInitializingProxy(Object object) {
- return (Class<?>)HObject.invokeStaticMethod(CL,
"getClassWithoutInitializingProxy"); //$NON-NLS-1$
+ return (Class<?>)HObject.invokeStaticMethod(CL,
"getClassWithoutInitializingProxy", object); //$NON-NLS-1$
}
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-09
13:57:31 UTC (rev 21398)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-09
14:01:58 UTC (rev 21399)
@@ -153,14 +153,26 @@
}
public ClassMetadataStub getClassMetadata(String entityName) {
- return new ClassMetadataStub(invoke(mn(), entityName));
+ Object obj = invoke(mn(), entityName);
+ if (obj == null) {
+ return null;
+ }
+ return new ClassMetadataStub(obj);
}
public CollectionMetadataStub getCollectionMetadata(String roleName) {
- return new CollectionMetadataStub(invoke(mn(), roleName));
+ Object obj = invoke(mn(), roleName);
+ if (obj == null) {
+ return null;
+ }
+ return new CollectionMetadataStub(obj);
}
public ClassMetadataStub getClassMetadata(Class<?> classWithoutInitializingProxy)
{
- return new ClassMetadataStub(invoke(mn(), classWithoutInitializingProxy));
+ Object obj = invoke(mn(), classWithoutInitializingProxy);
+ if (obj == null) {
+ return null;
+ }
+ return new ClassMetadataStub(obj);
}
}