use of org.seasar.doma.it.dao.SalesmanDaoImpl in project doma by domaframework.
the class AutoUpdateTest method testTenantId.
@Test
public void testTenantId(Config config) throws Exception {
SalesmanDao dao = new SalesmanDaoImpl(config);
Salesman salesman = dao.selectById(1);
Integer tenantId = salesman.departmentId;
salesman.departmentId = -1;
try {
dao.update(salesman);
fail();
} catch (OptimisticLockException expected) {
}
salesman.departmentId = tenantId;
dao.update(salesman);
}
use of org.seasar.doma.it.dao.SalesmanDaoImpl in project doma by domaframework.
the class AutoBatchDeleteTest method testTenantId.
@Test
public void testTenantId(Config config) throws Exception {
SalesmanDao dao = new SalesmanDaoImpl(config);
Salesman salesman = dao.selectById(1);
Integer tenantId = salesman.departmentId;
salesman.departmentId = -1;
try {
dao.delete(Arrays.asList(salesman));
fail();
} catch (OptimisticLockException expected) {
}
salesman.departmentId = tenantId;
dao.delete(Arrays.asList(salesman));
}
use of org.seasar.doma.it.dao.SalesmanDaoImpl in project doma by domaframework.
the class AutoBatchUpdateTest method testTenantId.
@Test
public void testTenantId(Config config) throws Exception {
SalesmanDao dao = new SalesmanDaoImpl(config);
Salesman salesman = dao.selectById(1);
Integer tenantId = salesman.departmentId;
salesman.departmentId = -1;
try {
dao.update(Arrays.asList(salesman));
fail();
} catch (OptimisticLockException expected) {
}
salesman.departmentId = tenantId;
dao.update(Arrays.asList(salesman));
}
use of org.seasar.doma.it.dao.SalesmanDaoImpl in project doma by domaframework.
the class AutoDeleteTest method testTenantId.
@Test
public void testTenantId(Config config) throws Exception {
SalesmanDao dao = new SalesmanDaoImpl(config);
Salesman salesman = dao.selectById(1);
Integer tenantId = salesman.departmentId;
salesman.departmentId = -1;
try {
dao.delete(salesman);
fail();
} catch (OptimisticLockException expected) {
}
salesman.departmentId = tenantId;
dao.delete(salesman);
}
Aggregations