|
|
|
@ -40,7 +40,12 @@ public abstract class BaseDaoJPA<T> implements BaseDao<T> {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void delete(T entity) {
|
|
|
|
|
sessionFactory.getCurrentSession().delete(entity);
|
|
|
|
|
try {
|
|
|
|
|
sessionFactory.getCurrentSession().delete(entity);
|
|
|
|
|
} catch (NonUniqueObjectException e) {
|
|
|
|
|
Object o = sessionFactory.getCurrentSession().merge(entity);
|
|
|
|
|
sessionFactory.getCurrentSession().delete(o);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|