20212223242526
@Override public Set<Directory> getRootDirectories() { String sql = "select id, path from library.directory where parent_id is null"; return new TreeSet<>(jdbcTemplate.query(sql, new DirectoryRowMapper())); }
27282930313233
@Override public Directory getDirectory(int directoryId) { String sql = "select id, path from library.directory where id = " + directoryId; return jdbcTemplate.queryForObject(sql, new DirectoryRowMapper()); }
34353637383940
@Override public Set<Directory> getSubDirectories(int directoryId) { String sql = "select id, path from library.directory where parent_id = " + directoryId; return new TreeSet<>(jdbcTemplate.query(sql, new DirectoryRowMapper())); }