@Test public void testInsert() throws Exception { ErasureCodingPolicyInfo ecPolicyInfo = new ErasureCodingPolicyInfo((byte) 2, "PolicyInfo1"); ecPolicyDao.insert(ecPolicyInfo); Assert.assertTrue(ecPolicyDao.getEcPolicyByName("PolicyInfo1").equals(ecPolicyInfo)); Assert.assertTrue(ecPolicyDao.getEcPolicyById((byte) 2).equals(ecPolicyInfo)); }
public void insert(ErasureCodingPolicyInfo ecPolicy) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(dataSource); simpleJdbcInsert.setTableName(TABLE_NAME); simpleJdbcInsert.execute(toMap(ecPolicy)); }
ErasureCodingPolicyDao { public void insert(ErasureCodingPolicyInfo ecPolicy) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(dataSource); simpleJdbcInsert.setTableName(TABLE_NAME); simpleJdbcInsert.execute(toMap(ecPolicy)); } }
ErasureCodingPolicyDao { public void insert(ErasureCodingPolicyInfo ecPolicy) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(dataSource); simpleJdbcInsert.setTableName(TABLE_NAME); simpleJdbcInsert.execute(toMap(ecPolicy)); } ErasureCodingPolicyDao(DataSource dataSource); }
ErasureCodingPolicyDao { public void insert(ErasureCodingPolicyInfo ecPolicy) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(dataSource); simpleJdbcInsert.setTableName(TABLE_NAME); simpleJdbcInsert.execute(toMap(ecPolicy)); } ErasureCodingPolicyDao(DataSource dataSource); ErasureCodingPolicyInfo getEcPolicyById(byte id); ErasureCodingPolicyInfo getEcPolicyByName(String policyName); List<ErasureCodingPolicyInfo> getAllEcPolicies(); void insert(ErasureCodingPolicyInfo ecPolicy); void insert(List<ErasureCodingPolicyInfo> ecInfos); void deleteAll(); }
ErasureCodingPolicyDao { public void insert(ErasureCodingPolicyInfo ecPolicy) { SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(dataSource); simpleJdbcInsert.setTableName(TABLE_NAME); simpleJdbcInsert.execute(toMap(ecPolicy)); } ErasureCodingPolicyDao(DataSource dataSource); ErasureCodingPolicyInfo getEcPolicyById(byte id); ErasureCodingPolicyInfo getEcPolicyByName(String policyName); List<ErasureCodingPolicyInfo> getAllEcPolicies(); void insert(ErasureCodingPolicyInfo ecPolicy); void insert(List<ErasureCodingPolicyInfo> ecInfos); void deleteAll();  }