Department.class,
Long.toString(
DatabaseImpl.getDepartmentIdFromPool())),
false);
Project p = new Project("Name-" + Alea.randomstring(4, 5), d);
p.setBudget(BigDecimal.valueOf(Alea.rand(1, 150000)));
pm.makePersistent(p);
logger.log(BasicLevel.DEBUG, "Create a new project id :" + p.getProid());
outStr.append("\nAdd project : ").append(p.getProid());
pollsSync.addInPool(DatabaseImpl.poolOfProjectId, p.getProid());
pm.setUserObject( pollsSync);
int nbEmployees = Alea.rand(MIN_MEMBER_PER_PROJECT, MAX_MEMBER_PER_PROJECT);
Employee e = null;
for (int i = 0; i < nbEmployees; i++) {
e = (Employee) pm.getObjectById(
pm.newObjectIdInstance(
Employee.class,
Long.toString(
DatabaseImpl.getEmployeeIdFromPool())),
false);
if (!p.addMember(e)) {
i--;
}
}
outStr.append(" with ").append(nbEmployees).append(" members");
}