Skip to content

Commit db11dc7

Browse files
committed
Refactor getAll method in Column class
Revised the getAll method in the Column class to return a SearchResults object instead of a list of SearchResult. The change improves the readability of the class and enhances the maintainability of the code.
1 parent 2584d7d commit db11dc7

File tree

1 file changed

+2
-2
lines changed
  • src/main/java/de/goldendeveloper/mysql/entities

1 file changed

+2
-2
lines changed

src/main/java/de/goldendeveloper/mysql/entities/Column.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public Column(String name, Table table, MYSQL mysql) {
3636
*
3737
* @return A SearchResults object containing all search results.
3838
*/
39-
public List<SearchResult> getAll() {
39+
public SearchResults getAll() {
4040
List<SearchResult> list = new ArrayList<>();
4141
executeQuery("SELECT `" + this.name + "` FROM `" + table.getName() + "`;", rs -> list.add(new SearchResult(rs.getString(1))), mysql);
42-
return list;
42+
return new SearchResults(list);
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)