Author: vyemialyanchyk
Date: 2010-03-19 14:47:45 -0400 (Fri, 19 Mar 2010)
New Revision: 20946
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-19
18:45:29 UTC (rev 20945)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-03-19
18:47:45 UTC (rev 20946)
@@ -241,7 +241,7 @@
if (sessionStubFactory != null) {
throw new
HibernateConsoleRuntimeException(ConsoleMessages.ConsoleConfiguration_factory_not_closed_before_build_new_factory);
}
- sessionStubFactory = new SessionStubFactory(executionContext, configStub);
+ sessionStubFactory = new SessionStubFactory(configStub);
fireFactoryBuilt();
return null;
}
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-19
18:45:29 UTC (rev 20945)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStub.java 2010-03-19
18:47:45 UTC (rev 20946)
@@ -19,8 +19,6 @@
import org.hibernate.console.ConsoleMessages;
import org.hibernate.console.ConsoleQueryParameter;
import org.hibernate.console.QueryInputModel;
-import org.hibernate.console.execution.ExecutionContext;
-import org.hibernate.console.execution.ExecutionContext.Command;
import org.hibernate.console.util.CollectionPropertySource;
import org.hibernate.engine.SessionImplementor;
import org.hibernate.metadata.ClassMetadata;
@@ -33,11 +31,9 @@
public class SessionStub {
- protected ExecutionContext executionContext;
protected Session session;
- protected SessionStub(ExecutionContext executionContext, Session session) {
- this.executionContext = executionContext;
+ protected SessionStub(Session session) {
this.session = session;
}
@@ -138,23 +134,15 @@
}
public IPropertyDescriptor[] getPropertyDescriptors(final Object obj) {
- IPropertyDescriptor[] propertyDescriptors = null;
- if (executionContext != null) {
- propertyDescriptors = (IPropertyDescriptor[]) executionContext.execute(new Command()
{
- public Object execute() {
- SessionFactory sf = session.getSessionFactory();
- ClassMetadata classMetadata;
- if (session.isOpen()) {
- classMetadata = sf.getClassMetadata(session.getEntityName(obj));
- } else {
- classMetadata = sf.getClassMetadata(HibernateProxyHelper
- .getClassWithoutInitializingProxy(obj));
- }
- return initializePropertyDescriptors(classMetadata);
- }
- });
+ SessionFactory sf = session.getSessionFactory();
+ ClassMetadata classMetadata;
+ if (session.isOpen()) {
+ classMetadata = sf.getClassMetadata(session.getEntityName(obj));
+ } else {
+ classMetadata = sf.getClassMetadata(HibernateProxyHelper
+ .getClassWithoutInitializingProxy(obj));
}
- return propertyDescriptors;
+ return initializePropertyDescriptors(classMetadata);
}
protected IPropertyDescriptor[] initializePropertyDescriptors(ClassMetadata
classMetadata) {
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java
===================================================================
---
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java 2010-03-19
18:45:29 UTC (rev 20945)
+++
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/stubs/SessionStubFactory.java 2010-03-19
18:47:45 UTC (rev 20946)
@@ -9,7 +9,6 @@
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleMessages;
-import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.util.ELTransformer;
import org.hibernate.console.util.QLFormatHelper;
import org.hibernate.engine.query.HQLQueryPlan;
@@ -21,11 +20,9 @@
public class SessionStubFactory {
- protected ExecutionContext executionContext;
protected SessionFactory sessionFactory;
- public SessionStubFactory(ExecutionContext executionContext, ConfigurationStub
configStub) {
- this.executionContext = executionContext;
+ public SessionStubFactory(ConfigurationStub configStub) {
sessionFactory = configStub.buildSessionFactory();
}
@@ -35,7 +32,7 @@
public SessionStub openSession() {
if (sessionFactory != null) {
- return new SessionStub(executionContext, sessionFactory.openSession());
+ return new SessionStub(sessionFactory.openSession());
}
return null;
}