use of tutorial.entity.Employee in project stackoverflow-qa by yukihane.
the class BatchDeleteTest method testBatchDelete.
public void testBatchDelete() throws Exception {
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
List<Employee> list = dao.selectAll();
dao.batchDelete(list);
tx.commit();
} finally {
tx.rollback();
}
}
use of tutorial.entity.Employee in project stackoverflow-qa by yukihane.
the class BatchInsertTest method testBatchInsert.
public void testBatchInsert() throws Exception {
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
Employee employee1 = new Employee();
employee1.setName("test-1");
employee1.setAge(30);
employee1.setSalary(new Salary(300));
Employee employee2 = new Employee();
employee2.setName("test-2");
employee2.setAge(40);
employee2.setSalary(new Salary(500));
dao.batchInsert(Arrays.asList(employee1, employee2));
tx.commit();
} finally {
tx.rollback();
}
}
use of tutorial.entity.Employee in project stackoverflow-qa by yukihane.
the class DeleteTest method testDeleteWithSqlFile.
public void testDeleteWithSqlFile() throws Exception {
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
Employee employee = dao.selectById(1);
dao.deleteWithSqlFile(employee);
tx.commit();
} finally {
tx.rollback();
}
}
use of tutorial.entity.Employee in project stackoverflow-qa by yukihane.
the class InsertTest method testInsertWithSqlFile.
public void testInsertWithSqlFile() throws Exception {
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
Employee employee = new Employee();
employee.setId(100);
employee.setName("test");
employee.setAge(50);
employee.setSalary(new Salary(300));
employee.setJobType(JobType.PRESIDENT);
employee.setInsertTimestamp(new Timestamp(System.currentTimeMillis()));
employee.setVersion(1);
dao.insertWithSqlFile(employee);
tx.commit();
} finally {
tx.rollback();
}
}
use of tutorial.entity.Employee in project stackoverflow-qa by yukihane.
the class InsertTest method testInsert.
public void testInsert() throws Exception {
LocalTransaction tx = AppConfig.getLocalTransaction();
try {
tx.begin();
Employee employee = new Employee();
employee.setName("test");
employee.setAge(50);
employee.setSalary(new Salary(300));
employee.setJobType(JobType.PRESIDENT);
dao.insert(employee);
tx.commit();
} finally {
tx.rollback();
}
}
Aggregations