return (PK) getSession().save(newInstance);
}
+ /**
+ * Persist the newInstance object into database.
+ *
+ * @param newInstance
+ * new object as a transient instance
+ */
+ @SuppressWarnings(UNCHECKED)
+ public void saveOrUpdate(final T newInstance) {
+ getSession().saveOrUpdate(newInstance);
+ }
+
/**
* Retrieve an object that was previously persisted to the database using the indicated id as primary key.
*
*/
PK create(T newInstance);
+ /**
+ * Persist the newInstance object into database.
+ *
+ * @param newInstance
+ * new object as a transient instance
+ */
+ public void saveOrUpdate(final T newInstance);
+
/**
* Retrieve an object that was previously persisted to the database using the indicated id as primary key.
*
// and to avoid th exception:
// org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the
// session: [org.splat.dal.bo.kernel.Role#simer]
- getUserDAO().merge(nuser);
+ getUserDAO().saveOrUpdate(nuser);
- getUserDAO().create(nuser);
+ //getUserDAO().create(nuser);
return nuser;
}
import org.splat.dal.bo.kernel.User;
import org.splat.dal.bo.som.Document;
+import org.splat.dal.bo.som.Document.Properties;
import org.splat.dal.bo.som.DocumentType;
import org.splat.dal.bo.som.Publication;
import org.splat.dal.bo.som.Scenario;
import org.splat.dal.bo.som.Study;
-import org.splat.dal.bo.som.Document.Properties;
import org.splat.dal.dao.som.Database;
import org.splat.dal.dao.som.ScenarioDAO;
import org.splat.kernel.InvalidPropertyException;
import org.splat.service.dto.FileDTO;
import org.splat.service.dto.StepDTO;
import org.splat.service.technical.ProjectSettingsService;
-import org.splat.service.technical.RepositoryService;
import org.splat.service.technical.ProjectSettingsService.Step;
+import org.splat.service.technical.RepositoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.hibernate3.HibernateTemplate;