product.setName("Product 1");
product.setPrefix("P1");
product.setLastKey(new Long(9));
PmProduct.instance().persist(product, em, context);
Deployment deployment = new Deployment();
deployment.setName("release 1.3");
deployment.setReleaseNumber("01");
deployment.setVersionNumber("03");
Calendar cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (24 * 60 * 60 * 1000));
deployment.setStartTime(cal);
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (4 * 7 * 24 * 60 * 60 * 1000));
deployment.setReleaseTime(cal);
deployment.setDescription("jaada jaada jaada...\npada pada pada");
deployment.setProduct(product);
product.getDeployment().add(deployment);
PmDeployment.instance().persist(deployment, em, context);
Item item = new Item();
item.setSummary("Item 1.3 summary");
item.setEffort(new Integer(5));
item.setItemKey("P1-3");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (7*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
Task task = new Task();
task.setName("Task 1.3.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ItemImplementation ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
TaskEstimation tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
Task prevTask = task;
task = new Task();
task.setName("Task 1.3.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
Item prevItem = item;
item = new Item();
item.setSummary("Item 1.2 summary");
item.setEffort(new Integer(14));
item.setItemKey("P1-2");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setNextId(prevItem.getId());
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
task = new Task();
task.setName("Task 1.2.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevTask = task;
task = new Task();
task.setName("Task 1.2.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevItem = item;
item = new Item();
item.setSummary("Item 1.1 summary");
item.setEffort(new Integer(8));
item.setItemKey("P1-1");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setNextId(prevItem.getId());
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
task = new Task();
task.setName("Task 1.1.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevTask = task;
task = new Task();
task.setName("Task 1.1.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
Deployment prevDeployment = deployment;
deployment = new Deployment();
deployment.setName("release 1.2");
deployment.setReleaseNumber("01");
deployment.setVersionNumber("02");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (4* 7 * 24 * 60 * 60 * 1000));
deployment.setStartTime(cal);
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis());
deployment.setReleaseTime(cal);
deployment.setDescription("jaada jaada jaada...\npada pada pada");
deployment.setNextId(prevDeployment.getId());
deployment.setProduct(product);
product.getDeployment().add(deployment);
PmDeployment.instance().persist(deployment, em, context);
item = new Item();
item.setSummary("Item 2.3 summary");
item.setEffort(new Integer(5));
item.setItemKey("P1-6");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (7*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
task = new Task();
task.setName("Task 2.3.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (4*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevTask = task;
task = new Task();
task.setName("Task 2.3.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (5*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevItem = item;
item = new Item();
item.setSummary("Item 2.2 summary");
item.setEffort(new Integer(14));
item.setItemKey("P1-5");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setNextId(prevItem.getId());
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
task = new Task();
task.setName("Task 2.2.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (1*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevTask = task;
task = new Task();
task.setName("Task 2.2.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevItem = item;
item = new Item();
item.setSummary("Item 2.1 summary");
item.setEffort(new Integer(8));
item.setItemKey("P1-4");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() + (4*24*60*60*1000));
item.setDueDate(cal);
item.setDescription("diiba daaba\njou jou");
item.setItemType(ItemType.FEATURE);
item.setNextId(prevItem.getId());
item.setDeployment(deployment);
deployment.getItems().add(item);
PmDeployment.instance().persist(item, em, context);
task = new Task();
task.setName("Task 2.1.2 name");
task.setEstimation(new Integer(8));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
ii = new ItemImplementation();
item.getItemImplementation().add(ii);
ii.setItem(item);
PmDeployment.instance().persist(ii, em, context);
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(8));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (3*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevTask = task;
task = new Task();
task.setName("Task 2.1.1 name");
task.setEstimation(new Integer(5));
task.setDescription("xxxxxxxx\nyyyyyyyyy");
task.setTaskStatus(TaskStatus.NOT_STARTED);
task.setNextId(prevTask.getId());
ii.getTasks().add(task);
task.setItemImplementation(ii);
PmDeployment.instance().persist(task, em, context);
tes = new TaskEstimation();
tes.setEstimation(new Integer(5));
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (2*24*60*60*1000));
tes.setEstimationDate(new Date(cal.getTimeInMillis()));
tes.setTask(task);
PmDeployment.instance().persist(tes, em, context);
prevDeployment = deployment;
deployment = new Deployment();
deployment.setName("release 1.1");
deployment.setReleaseNumber("01");
deployment.setVersionNumber("01");
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (8 * 7 * 24 * 60 * 60 * 1000));
deployment.setStartTime(cal);
cal = GregorianCalendar.getInstance();
cal.setTimeInMillis(System.currentTimeMillis() - (4 * 7 * 24 * 60 * 60 * 1000));
deployment.setReleaseTime(cal);
deployment.setDescription("jaada jaada jaada...\npada pada pada");
deployment.setNextId(prevDeployment.getId());
deployment.setProduct(product);
product.getDeployment().add(deployment);
PmDeployment.instance().persist(deployment, em, context);
item = new Item();