title: How to cast resultset in rowmapper to an enum?
body: <p>I have my rowmapper like:</p>
  
  <pre><code>private static final class UserRowMapper implements RowMapper&lt;User&gt; {
  
      User user = new User();
  
        user.setId(rs.getInt("id"));
        user.setUserType( (UserType)rs.getInt("userType")); // ?????
  
      return user;
  
  }
  </code></pre>
  
  <p>So I am trying to cast the integer value in the db for userType to the enumeration UserType.</p>
  
  <p>Why doesn't this work?</p>