private void initialise() {

    Workbook workbook = WorkbookSingleton.getWorkbook(workbookFileName);
    Sheet currentSheet = workbook.getSheet(ColumnIndexes.UE__SHEETNO);

    Cell[] row;

    for (int i = 1; i < currentSheet.getRows(); i++) {
      row = currentSheet.getRow(i);

      if (row.length > 0) {
        String concatCapabilities = row[ColumnIndexes.UE_ACCESSCAPABILITY_COLNO].getContents();
        String[] indivCapabilities = concatCapabilities.split(", ");
        for (int j = 0; j < indivCapabilities.length; j++) {
          if (PersistenceUtil.findAccessCapability(indivCapabilities[j]) == null) {
            createAccessCapability(indivCapabilities[j]);
          }
        }
      }
    }
  }
 private static void addObjectsToDb() {
   PersistenceUtil.persistMany(failureClasses);
 }
 public void createAccessCapability(String accessCapabilityString) {
   AccessCapability accessCapability = new AccessCapability(accessCapabilityString);
   PersistenceUtil.persist(accessCapability);
 }
Пример #4
0
 public void createFailure(int failureID, String failureDescription) {
   Failure failure = new Failure(failureID, failureDescription);
   PersistenceUtil.persist(failure);
 }