Added a JPA NamedQuery to the UserEntity entity and worked LoginBean to make sense of the new distinction between User and UserEntity.