Skip to content

Conversation

@wanglunhui2012
Copy link

For below case :

public static class UserEntity{ private Long id; private String name; private String password; private LocalDateTime createTime; public UserEntity(Long id, String name, String password, LocalDateTime createTime) { this.id = id; this.name = name; this.password = password; this.createTime = createTime; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public LocalDateTime getCreateTime() { return createTime; } public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; } @Override public String toString() { return "UserEntity{" + "id=" + id + ", name='" + name + '\'' + ", password='" + password + '\'' + ", createTime=" + createTime + '}'; } } @Mapper public interface UserMapper{ @Select("select id,name,create_time from user where id = #{id}") UserEntity selectAllField(int id); } public static void main(String[] args) { try (SqlSession session = sqlSessionFactory.openSession()) { UserMapper mapper = session.getMapper(UserMapper.class); UserEntity userEntity1 = mapper.selectAllField(1); System.out.println(userEntity1); } }

we can know more information about the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant