/**
* save experiment
*/
public void save() {
EntityManager em = ResourceUtils.getEntityManager();
Experiment existingExp = em.find(Experiment.class, expID);
em.close();
em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
Experiment experiment = new Experiment();
Project projectmodel = em.find(Project.class, project.getName());
experiment.setProject(projectmodel);
Users user = em.find(Users.class, getWorker().getUser());
Gateway gateway = em.find(Gateway.class, getGateway().getGatewayName());
experiment.setProject(projectmodel);
experiment.setExperiment_ID(getExpID());
experiment.setUser(user);
experiment.setGateway(gateway);
experiment.setSubmitted_date(submittedDate);
if(existingExp != null){
existingExp.setGateway(gateway);
existingExp.setProject(projectmodel);
existingExp.setUser(user);
existingExp.setSubmitted_date(submittedDate);