title: Spring @Query annotation with enum parameter
body: <p>Is it possible to use enum parameter with @Query annotation?</p>
  
  <p>Here is the code I'm using to find user role:</p>
  
  <pre><code>Role userRole = roleRepository.findByRole(Roles.USER);
  if ( userRole == null ) {
      LOGGER.debug("No role found with role: {}", Roles.USER);
  }
  </code></pre>
  
  <p>and it prints out</p>
  
  <pre><code>No role found with role: ROLE_USER
  </code></pre>
  
  <p>but if I try to find all roles this is what I get:</p>
  
  <pre><code>for ( Role r : roleRepository.findAll() )
      LOGGER.debug("{}", r);
  
  Role@8a8c0a[roleId=1,role=role_admin,version=0]
  Role@1efe9ee[roleId=2,role=role_staff,version=0]
  Role@1e70f68[roleId=3,role=role_user,version=0]
  Role@a475d1[roleId=4,role=role_guest,version=0]
  </code></pre>
  
  <p>As you can see user role does exists.</p>
  
  <p>RoleRepository:</p>
  
  <pre><code>public interface RoleRepository extends JpaRepository&lt;Role, Long&gt; {
  
      @Query("SELECT r FROM Role r WHERE LOWER(r.role) = LOWER(:role)")
      public Role findByRole(@Param("role") Roles role);
  
  }
  </code></pre>
  
  <p>Role:</p>
  
  <pre><code>@Entity
  @Table(name = "role")
  public class Role {
  
      public enum Roles {
  
          ADMIN("ROLE_ADMIN"),
          STAFF("ROLE_STAFF"),
          USER("ROLE_USER"),
          GUEST("ROLE_GUEST");
  
          private String role;
  
          private Roles(String role) {
              this.role = role;
          }
  
          public String getRole() {
              return role;
          }
  
          @Override
          public String toString() {
              return role;
          }
  
      }
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "role_id", updatable = false)
      private Long roleId;
  
      @Column(name = "role")
      private String role;
  
      @Version
      @Column(name = "version")
      private long version = 0;
  
      public Long getRoleId() {
          return roleId;
      }
  
      public String getRole() {
          return role;
      }
  
      public long getVersion() {
          return version;
      }
  
      @Override
      public String toString() {
          return new ReflectionToStringBuilder(this).toString();
      }
  
  }
  </code></pre>