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