use of org.activityinfo.server.database.hibernate.entity.Project in project activityinfo by bedatadriven.
the class AddProjectHandler method execute.
@Override
public CommandResult execute(AddProject cmd, User user) {
Database db = em.find(Database.class, cmd.getDatabaseId());
ProjectDTO from = cmd.getProjectDTO();
Project project = new Project();
project.setName(from.getName());
project.setDescription(from.getDescription());
project.setDatabase(db);
db.setLastSchemaUpdate(new Date());
em.persist(project);
em.persist(db);
db.getProjects().add(project);
return new CreateResult(project.getId());
}
Aggregations