code: public void scanProjects(int parentProjectID)
      {
          ClassProject classProject = new ClassProject(this);
          try {
              classProject.addNew();
              classProject.setKeyArea(ClassProject.ID_KEY);
              classProject.getField(ClassProject.ID).setValue(parentProjectID);
              if (classProject.seek(null))
              {
                  if (isBaseDatabase(classProject))
                      this.scanAllPackages(classProject);
              }
              IntegerField field = new IntegerField(null, null, -1, null, null);
              field.setValue(parentProjectID);
              classProject.addNew();
              classProject.close();
              classProject.setKeyArea(ClassProject.PARENT_FOLDER_ID_KEY);
              classProject.addListener(new SubFileFilter(field, ClassProject.PARENT_FOLDER_ID, null, null, null, null));
              while (classProject.hasNext())
              {
                  classProject.next();
                  this.scanProjects((int)classProject.getField(ClassProject.ID).getValue());
              }
              field.free();
          } catch (DBException e) {
              e.printStackTrace();
          } finally {
              classProject.free();
          }
      }
docs: ScanProjects Method.