Author: vyemialyanchyk
Date: 2010-05-07 07:24:41 -0400 (Fri, 07 May 2010)
New Revision: 21952
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5997 - fix in trunk
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-05-07
11:11:55 UTC (rev 21951)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2010-05-07
11:24:41 UTC (rev 21952)
@@ -156,8 +156,6 @@
Map<Object,Object> overrides = new HashMap<Object,Object>();
if(properties!=null) {
overrides.putAll( properties );
- } else {
- overrides.put("hibernate.search.autoregister_listeners",
"false"); //$NON-NLS-1$ //$NON-NLS-2$
}
if(StringHelper.isNotEmpty( prefs.getNamingStrategy())) {
overrides.put( "hibernate.ejb.naming_strategy", prefs.getNamingStrategy()
); //$NON-NLS-1$
@@ -187,6 +185,13 @@
throw new HibernateConsoleRuntimeException(out);
}
+ method = clazz.getMethod("getProperties", new Class[] {}); //$NON-NLS-1$
+ Properties props = (Properties)method.invoke(ejb3cfg, new Object[] {} );
+ if (props.getProperty("hibernate.search.autoregister_listeners") == null) {
//$NON-NLS-1$
+ method = clazz.getMethod("setProperty", new Class[] { String.class,
String.class }); //$NON-NLS-1$
+ method.invoke(ejb3cfg, new Object[] {
"hibernate.search.autoregister_listeners", "false" } ); //$NON-NLS-1$
//$NON-NLS-2$
+ }
+
method = clazz.getMethod("getHibernateConfiguration", new
Class[0]);//$NON-NLS-1$
Configuration invoke = (Configuration) method.invoke(ejb3cfg, (Object[])null);
invoke = configureConnectionProfile(invoke);
@@ -749,7 +754,9 @@
if(properties!=null) {
localCfg = localCfg.setProperties(properties);
} else {
- localCfg.setProperty("hibernate.search.autoregister_listeners",
"false"); //$NON-NLS-1$ //$NON-NLS-2$
+ if (localCfg.getProperty("hibernate.search.autoregister_listeners") == null)
{ //$NON-NLS-1$
+ localCfg.setProperty("hibernate.search.autoregister_listeners",
"false"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
EntityResolver entityResolver = XMLHelper.DEFAULT_DTD_RESOLVER;
if(StringHelper.isNotEmpty(prefs.getEntityResolverName())) {