I have a standard MySql DB with a User Table. In this table there is a TINYINT(4) named "isApproved"
For this user it is set to "1" (which i believe is true) My bean property looks like this:
private boolean isApproved;
and the appropriate getters/setters:
public boolean isApproved() {
return isApproved;
}
public void setApproved(boolean isApproved) {
this.isApproved = isApproved;
}
I have a jdbcTemplate that is pulling the correct user and it looks like this:
public UserBean findUserByUserName(String userName) {
String sql = "SELECT * FROM User WHERE name = ?";
return (UserBean)getJdbcTemplate().queryForObject(sql, new BeanPropertyRowMapper<UserBean>(UserBean.class), userName);
}
So I think I may have made a simple mistake and I add this to the logging:
logger.debug("User from DB isApproved:"+userFromDb.isApproved());
This is coming back "false", even when there is a "1" in the DB.
How do I make this mapping correct, the isApproved is "1" which should equate to true as a boolean.