Skip to content

Commit

Permalink
refactor: UserRowMapper 람다식으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
parkmuhyeun committed Sep 26, 2023
1 parent 1fdc8db commit a19e03e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
8 changes: 7 additions & 1 deletion app/src/main/java/com/techcourse/dao/UserDao.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.techcourse.dao;

import com.techcourse.domain.User;
import org.springframework.dao.RowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class UserDao {

private static final UserRowMapper rowMapper = new UserRowMapper();
private static final RowMapper<User> rowMapper = (resultSet) -> new User(
resultSet.getLong("id"),
resultSet.getString("account"),
resultSet.getString("password"),
resultSet.getString("email")
);

private final JdbcTemplate jdbcTemplate;

Expand Down
20 changes: 0 additions & 20 deletions app/src/main/java/com/techcourse/dao/UserRowMapper.java

This file was deleted.

0 comments on commit a19e03e

Please sign in to comment.