/**
* save project to the database
*/
public void save() {
EntityManager em = ResourceUtils.getEntityManager();
Project existingprojectResource = em.find(Project.class, name);
em.close();
em = ResourceUtils.getEntityManager();
em.getTransaction().begin();
Project project = new Project();
project.setProject_name(name);
Gateway modelGateway = em.find(Gateway.class, gateway.getGatewayName());
project.setGateway(modelGateway);
Users user = em.find(Users.class, worker.getUser());
project.setUsers(user);
if(existingprojectResource != null){
existingprojectResource.setGateway(modelGateway);
existingprojectResource.setUsers(user);
project = em.merge(existingprojectResource);