RedisDao extends AbstractXpipeConsoleDAO { @DalTransaction public void updateBatchKeeperActive(List<RedisTbl> redises) { queryHandler.handleBatchUpdate(new DalQuery<int[]>() { @Override public int[] doQuery() throws DalException { return redisTblDao.updateBatchKeeperActive(redises.toArray(new RedisTbl[redises.size()]), RedisTblEntity.UPDATESET_FULL); } }); }  RedisTbl findByPK(long id); List<RedisTbl> findAllByDcClusterShard(final long dcClusterShardId); @DalTransaction int[] createRedisesBatch(List<RedisTbl> redises); @DalTransaction RedisTbl createRedisesBatch(RedisTbl redis); @DalTransaction void deleteRedisesBatch(List<RedisTbl> redises); @DalTransaction void updateBatch(List<RedisTbl> redises); @DalTransaction void updateBatchMaster(List<RedisTbl> redises); @DalTransaction void updateBatchKeeperActive(List<RedisTbl> redises); @DalTransaction void handleUpdate(List<RedisTbl> toCreate, List<RedisTbl> toDelete, List<RedisTbl> left); static List<RedisTbl> findWithRole(List<RedisTbl> redises, String role);  }
@Test public void testUpdateBatchKeeperActive() throws DalException { for(RedisTbl redisTbl : redises){ redisTbl.setKeeperActive(!redisTbl.isKeeperActive()); } redisDao.updateBatchKeeperActive(redises); for(RedisTbl redisTbl : redises){ RedisTbl byPK = redisDao.findByPK(redisTbl.getId()); Assert.assertEquals(redisTbl.isKeeperActive(), byPK.isKeeperActive()); } }