Skip to content
Snippets Groups Projects
Commit a65fb6d9 authored by jakubs's avatar jakubs
Browse files

BIS-153 SP-257 remove some of the unwanted package dependencies

SVN: 26434
parent 9f5f213f
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,6 @@ import org.hibernate.Transaction;
import org.hibernate.type.Type;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.server.CommonServiceProvider;
import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.DynamicPropertyEvaluator;
import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.IDynamicPropertyEvaluator;
import ch.systemsx.cisd.openbis.generic.server.business.bo.dynamic_property.calculator.EntityAdaptorFactory;
......@@ -57,9 +56,11 @@ public class EntityVerificationInterceptor extends EmptyInterceptor
private IDAOFactory daoFactory;
public EntityVerificationInterceptor(IHibernateTransactionManagerCallback callback)
public EntityVerificationInterceptor(IHibernateTransactionManagerCallback callback,
IDAOFactory daoFactory)
{
this.callback = callback;
this.daoFactory = daoFactory;
initializeLists();
}
......@@ -196,7 +197,7 @@ public class EntityVerificationInterceptor extends EmptyInterceptor
{
EntityValidationCalculator calculator =
EntityValidationCalculator.create(script.getScript());
IDynamicPropertyEvaluator evaluator = new DynamicPropertyEvaluator(getDAOFactory(), null);
IDynamicPropertyEvaluator evaluator = new DynamicPropertyEvaluator(daoFactory, null);
IEntityAdaptor adaptor = EntityAdaptorFactory.create(entity, evaluator);
calculator.setEntity(adaptor);
calculator.setIsNewEntity(isNewEntity);
......@@ -258,13 +259,4 @@ public class EntityVerificationInterceptor extends EmptyInterceptor
newDatasets = new HashSet<DataPE>();
}
private IDAOFactory getDAOFactory()
{
if (daoFactory == null)
{
daoFactory = CommonServiceProvider.getDAOFactory();
}
return daoFactory;
}
}
......@@ -27,7 +27,8 @@ import org.springframework.orm.hibernate3.HibernateTransactionManager;
import org.springframework.orm.hibernate3.SessionHolder;
import org.springframework.transaction.support.DefaultTransactionStatus;
import ch.systemsx.cisd.openbis.generic.client.web.client.exception.UserFailureException;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.server.dataaccess.IDAOFactory;
import ch.systemsx.cisd.openbis.generic.shared.basic.dto.ServiceVersionHolder;
/**
......@@ -42,6 +43,13 @@ public class OpenBISHibernateTransactionManager extends HibernateTransactionMana
private static final long serialVersionUID = ServiceVersionHolder.VERSION;
private IDAOFactory daoFactory;
public OpenBISHibernateTransactionManager(IDAOFactory daoFactory)
{
this.daoFactory = daoFactory;
}
WeakHashMap<Transaction, String> rolledBackTransactions =
new WeakHashMap<Transaction, String>();
......@@ -55,7 +63,7 @@ public class OpenBISHibernateTransactionManager extends HibernateTransactionMana
@Override
public Interceptor getEntityInterceptor() throws IllegalStateException, BeansException
{
return new EntityVerificationInterceptor(this);
return new EntityVerificationInterceptor(this, daoFactory);
}
@Override
......
......@@ -19,6 +19,7 @@
<bean id="transaction-manager"
class="ch.systemsx.cisd.openbis.generic.server.dataaccess.db.OpenBISHibernateTransactionManager">
<constructor-arg ref="dao-factory" />
<property name="sessionFactory" ref="hibernate-session-factory" />
<property name="jdbcExceptionTranslator" ref="exception-translator" />
</bean>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment