use of com.haulmont.cuba.testmodel.softdelete_notfounddeleted.SoftDelete_Task in project cuba by cuba-platform.
the class SoftDeleteNotFoundDeletedTest method setUp.
@Before
public void setUp() throws Exception {
dataManager = AppBeans.get(DataManager.class);
Transaction tx = cont.persistence().createTransaction();
try {
EntityManager em = cont.persistence().getEntityManager();
SoftDelete_Service service = new SoftDelete_Service();
serviceId = service.getId();
service.setName("service");
service.setCode("serviceCode");
em.persist(service);
SoftDelete_Task task = new SoftDelete_Task();
taskId = task.getId();
task.setMessage("message");
task.setService(service);
em.persist(task);
SoftDelete_TaskValue taskValue = new SoftDelete_TaskValue();
taskValueId = taskValue.getId();
taskValue.setTask(task);
em.persist(taskValue);
SoftDelete_Project project = new SoftDelete_Project();
projectId = project.getId();
project.setName("project");
project.setAValue(taskValue);
project.setTask(task);
em.persist(project);
tx.commitRetaining();
em = cont.persistence().getEntityManager();
task = em.find(SoftDelete_Task.class, taskId);
em.remove(task);
tx.commit();
} finally {
tx.end();
}
}
Aggregations