use of com.haulmont.bali.db.ArrayHandler in project cuba by cuba-platform.
the class SoftDeleteDataManagerTest method testHardDelete.
@Test
public void testHardDelete() throws Exception {
DataManager dataManager = AppBeans.get(DataManager.class);
User loadedUser = dataManager.load(LoadContext.create(User.class).setId(user.getId()));
CommitContext commitContext = new CommitContext().addInstanceToRemove(loadedUser);
commitContext.setSoftDeletion(false);
dataManager.commit(commitContext);
QueryRunner runner = new QueryRunner(persistence.getDataSource());
Object[] row = runner.query("select count(*) from sec_user where id = ?", user.getId().toString(), new ArrayHandler());
assertEquals(0, ((Number) row[0]).intValue());
}
Aggregations