test_class.declarator: fileDiffDao
test_class.modifier: private
test_class.original_string: private FileDiffDao fileDiffDao;
test_class.type: FileDiffDao
test_class.var_name: fileDiffDao
test_class.file: smart-metastore/src/test/java/org/smartdata/metastore/dao/TestFileDiffDao.java
test_class.identifier: TestFileDiffDao
test_class.superclass: extends TestDaoUtil
test_case.body: @Test
    public void testUpdate() {
      FileDiff[] fileDiffs = new FileDiff[2];
      fileDiffs[0] = new FileDiff();
      fileDiffs[0].setDiffId(1);
      fileDiffs[0].setRuleId(1);
      fileDiffs[0].setParameters(new HashMap<String, String>());
      fileDiffs[0].setSrc("test");
      fileDiffs[0].setState(FileDiffState.PENDING);
      fileDiffs[0].setDiffType(FileDiffType.APPEND);
      fileDiffs[0].setCreateTime(1);
  
      fileDiffs[1] = new FileDiff();
      fileDiffs[1].setDiffId(2);
      fileDiffs[0].setRuleId(1);
      fileDiffs[1].setParameters(new HashMap<String, String>());
      fileDiffs[1].setSrc("src");
      fileDiffs[1].setState(FileDiffState.PENDING);
      fileDiffs[1].setDiffType(FileDiffType.APPEND);
      fileDiffs[1].setCreateTime(1);
  
      fileDiffDao.insert(fileDiffs);
      fileDiffDao.update(1, FileDiffState.RUNNING);
      fileDiffs[0].setState(FileDiffState.RUNNING);
  
      Assert.assertTrue(fileDiffDao.getById(1).equals(fileDiffs[0]));
      Assert.assertTrue(fileDiffDao.getPendingDiff().size() == 1);
      fileDiffs[0].getParameters().put("-offset", "0");
      fileDiffs[0].setSrc("test1");
      fileDiffs[1].setCreateTime(2);
      fileDiffs[1].setRuleId(2);
      fileDiffs[1].setDiffType(FileDiffType.RENAME);
      fileDiffDao.update(fileDiffs);
      Assert.assertTrue(fileDiffDao.getById(1).equals(fileDiffs[0]));
      Assert.assertTrue(fileDiffDao.getById(2).equals(fileDiffs[1]));
    }
test_case.class_method_signature: TestFileDiffDao.testUpdate()
test_case.full_signature: @Test public void testUpdate()
test_case.identifier: testUpdate
test_case.invocations: setDiffId setRuleId setParameters setSrc setState setDiffType setCreateTime setDiffId setRuleId setParameters setSrc setState setDiffType setCreateTime insert update setState assertTrue equals getById assertTrue size getPendingDiff put getParameters setSrc setCreateTime setRuleId setDiffType update assertTrue equals getById assertTrue equals getById
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdate()
focal_class.declarator: TABLE_NAME = "file_diff"
focal_class.modifier: private static final
focal_class.original_string: private static final String TABLE_NAME = "file_diff";
focal_class.type: String
focal_class.var_name: TABLE_NAME
focal_class.declarator: dataSource
focal_class.modifier: private
focal_class.original_string: private DataSource dataSource;
focal_class.type: DataSource
focal_class.var_name: dataSource
focal_class.declarator: uselessFileDiffStates
focal_class.modifier: public
focal_class.original_string: public String uselessFileDiffStates;
focal_class.type: String
focal_class.var_name: uselessFileDiffStates
focal_class.file: smart-metastore/src/main/java/org/smartdata/metastore/dao/FileDiffDao.java
focal_class.identifier: FileDiffDao
focal_class.class_method_signature: FileDiffDao.setDataSource(DataSource dataSource)
focal_class.full_signature: public void setDataSource(DataSource dataSource)
focal_class.identifier: setDataSource
focal_class.modifiers: public
focal_class.parameters: (DataSource dataSource)
focal_class.return: void
focal_class.signature: void setDataSource(DataSource dataSource)
focal_class.class_method_signature: FileDiffDao.FileDiffDao(DataSource dataSource)
focal_class.full_signature: public  FileDiffDao(DataSource dataSource)
focal_class.identifier: FileDiffDao
focal_class.modifiers: public
focal_class.parameters: (DataSource dataSource)
focal_class.signature:  FileDiffDao(DataSource dataSource)
focal_class.class_method_signature: FileDiffDao.getUselessFileDiffState()
focal_class.full_signature: public String getUselessFileDiffState()
focal_class.identifier: getUselessFileDiffState
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUselessFileDiffState()
focal_class.class_method_signature: FileDiffDao.getAll()
focal_class.full_signature: public List<FileDiff> getAll()
focal_class.identifier: getAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getAll()
focal_class.class_method_signature: FileDiffDao.getPendingDiff()
focal_class.full_signature: public List<FileDiff> getPendingDiff()
focal_class.identifier: getPendingDiff
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getPendingDiff()
focal_class.class_method_signature: FileDiffDao.getByState(FileDiffState fileDiffState)
focal_class.full_signature: public List<FileDiff> getByState(FileDiffState fileDiffState)
focal_class.identifier: getByState
focal_class.modifiers: public
focal_class.parameters: (FileDiffState fileDiffState)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getByState(FileDiffState fileDiffState)
focal_class.class_method_signature: FileDiffDao.getByState(String prefix, FileDiffState fileDiffState)
focal_class.full_signature: public List<FileDiff> getByState(String prefix, FileDiffState fileDiffState)
focal_class.identifier: getByState
focal_class.modifiers: public
focal_class.parameters: (String prefix, FileDiffState fileDiffState)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getByState(String prefix, FileDiffState fileDiffState)
focal_class.class_method_signature: FileDiffDao.getPendingDiff(long rid)
focal_class.full_signature: public List<FileDiff> getPendingDiff(long rid)
focal_class.identifier: getPendingDiff
focal_class.modifiers: public
focal_class.parameters: (long rid)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getPendingDiff(long rid)
focal_class.class_method_signature: FileDiffDao.getPendingDiff(String prefix)
focal_class.full_signature: public List<FileDiff> getPendingDiff(String prefix)
focal_class.identifier: getPendingDiff
focal_class.modifiers: public
focal_class.parameters: (String prefix)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getPendingDiff(String prefix)
focal_class.class_method_signature: FileDiffDao.getByIds(List<Long> dids)
focal_class.full_signature: public List<FileDiff> getByIds(List<Long> dids)
focal_class.identifier: getByIds
focal_class.modifiers: public
focal_class.parameters: (List<Long> dids)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getByIds(List<Long> dids)
focal_class.class_method_signature: FileDiffDao.getByFileName(String fileName)
focal_class.full_signature: public List<FileDiff> getByFileName(String fileName)
focal_class.identifier: getByFileName
focal_class.modifiers: public
focal_class.parameters: (String fileName)
focal_class.return: List<FileDiff>
focal_class.signature: List<FileDiff> getByFileName(String fileName)
focal_class.class_method_signature: FileDiffDao.getSyncPath(int size)
focal_class.full_signature: public List<String> getSyncPath(int size)
focal_class.identifier: getSyncPath
focal_class.modifiers: public
focal_class.parameters: (int size)
focal_class.return: List<String>
focal_class.signature: List<String> getSyncPath(int size)
focal_class.class_method_signature: FileDiffDao.getById(long did)
focal_class.full_signature: public FileDiff getById(long did)
focal_class.identifier: getById
focal_class.modifiers: public
focal_class.parameters: (long did)
focal_class.return: FileDiff
focal_class.signature: FileDiff getById(long did)
focal_class.class_method_signature: FileDiffDao.delete(long did)
focal_class.full_signature: public void delete(long did)
focal_class.identifier: delete
focal_class.modifiers: public
focal_class.parameters: (long did)
focal_class.return: void
focal_class.signature: void delete(long did)
focal_class.class_method_signature: FileDiffDao.getUselessRecordsNum()
focal_class.full_signature: public int getUselessRecordsNum()
focal_class.identifier: getUselessRecordsNum
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getUselessRecordsNum()
focal_class.class_method_signature: FileDiffDao.deleteUselessRecords(int num)
focal_class.full_signature: public int deleteUselessRecords(int num)
focal_class.identifier: deleteUselessRecords
focal_class.modifiers: public
focal_class.parameters: (int num)
focal_class.return: int
focal_class.signature: int deleteUselessRecords(int num)
focal_class.class_method_signature: FileDiffDao.insert(FileDiff fileDiff)
focal_class.full_signature: public long insert(FileDiff fileDiff)
focal_class.identifier: insert
focal_class.modifiers: public
focal_class.parameters: (FileDiff fileDiff)
focal_class.return: long
focal_class.signature: long insert(FileDiff fileDiff)
focal_class.class_method_signature: FileDiffDao.insert(FileDiff[] fileDiffs)
focal_class.full_signature: public void insert(FileDiff[] fileDiffs)
focal_class.identifier: insert
focal_class.modifiers: public
focal_class.parameters: (FileDiff[] fileDiffs)
focal_class.return: void
focal_class.signature: void insert(FileDiff[] fileDiffs)
focal_class.class_method_signature: FileDiffDao.insert(List<FileDiff> fileDiffs)
focal_class.full_signature: public Long[] insert(List<FileDiff> fileDiffs)
focal_class.identifier: insert
focal_class.modifiers: public
focal_class.parameters: (List<FileDiff> fileDiffs)
focal_class.return: Long[]
focal_class.signature: Long[] insert(List<FileDiff> fileDiffs)
focal_class.class_method_signature: FileDiffDao.batchUpdate(
        final List<Long> dids, final List<FileDiffState> states,
        final List<String> parameters)
focal_class.full_signature: public int[] batchUpdate(
        final List<Long> dids, final List<FileDiffState> states,
        final List<String> parameters)
focal_class.identifier: batchUpdate
focal_class.modifiers: public
focal_class.parameters: (
        final List<Long> dids, final List<FileDiffState> states,
        final List<String> parameters)
focal_class.return: int[]
focal_class.signature: int[] batchUpdate(
        final List<Long> dids, final List<FileDiffState> states,
        final List<String> parameters)
focal_class.class_method_signature: FileDiffDao.batchUpdate(
        final List<Long> dids, final FileDiffState state)
focal_class.full_signature: public int[] batchUpdate(
        final List<Long> dids, final FileDiffState state)
focal_class.identifier: batchUpdate
focal_class.modifiers: public
focal_class.parameters: (
        final List<Long> dids, final FileDiffState state)
focal_class.return: int[]
focal_class.signature: int[] batchUpdate(
        final List<Long> dids, final FileDiffState state)
focal_class.class_method_signature: FileDiffDao.update(long did, FileDiffState state)
focal_class.full_signature: public int update(long did, FileDiffState state)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (long did, FileDiffState state)
focal_class.return: int
focal_class.signature: int update(long did, FileDiffState state)
focal_class.class_method_signature: FileDiffDao.update(long did, String src)
focal_class.full_signature: public int update(long did, String src)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (long did, String src)
focal_class.return: int
focal_class.signature: int update(long did, String src)
focal_class.class_method_signature: FileDiffDao.update(long did, FileDiffState state,
         String parameters)
focal_class.full_signature: public int update(long did, FileDiffState state,
         String parameters)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (long did, FileDiffState state,
         String parameters)
focal_class.return: int
focal_class.signature: int update(long did, FileDiffState state,
         String parameters)
focal_class.class_method_signature: FileDiffDao.update(final FileDiff[] fileDiffs)
focal_class.full_signature: public int[] update(final FileDiff[] fileDiffs)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (final FileDiff[] fileDiffs)
focal_class.return: int[]
focal_class.signature: int[] update(final FileDiff[] fileDiffs)
focal_class.class_method_signature: FileDiffDao.update(final FileDiff fileDiff)
focal_class.full_signature: public int update(final FileDiff fileDiff)
focal_class.identifier: update
focal_class.modifiers: public
focal_class.parameters: (final FileDiff fileDiff)
focal_class.return: int
focal_class.signature: int update(final FileDiff fileDiff)
focal_class.class_method_signature: FileDiffDao.deleteAll()
focal_class.full_signature: public void deleteAll()
focal_class.identifier: deleteAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deleteAll()
focal_class.class_method_signature: FileDiffDao.toMap(FileDiff fileDiff)
focal_class.full_signature: private Map<String, Object> toMap(FileDiff fileDiff)
focal_class.identifier: toMap
focal_class.modifiers: private
focal_class.parameters: (FileDiff fileDiff)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> toMap(FileDiff fileDiff)
focal_method.body: public int update(long did, FileDiffState state) {
      JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
      String sql = "UPDATE " + TABLE_NAME + " SET state = ? WHERE did = ?";
      return jdbcTemplate.update(sql, state.getValue(), did);
    }
focal_method.class_method_signature: FileDiffDao.update(long did, FileDiffState state)
focal_method.full_signature: public int update(long did, FileDiffState state)
focal_method.identifier: update
focal_method.invocations: update getValue
focal_method.modifiers: public
focal_method.parameters: (long did, FileDiffState state)
focal_method.return: int
focal_method.signature: int update(long did, FileDiffState state)