Hibernate having difficulty with '@' character in HQL
问题 Working with hibernate and spring social, I am trying to query the database by email address. when i do this query: public Account findAccountByUsername(String username) { Session session = sessionFactory.getCurrentSession(); String selectQuery = "FROM Account as account WHERE account.username = "+username; Query query = session.createQuery(selectQuery); @SuppressWarnings("unchecked") List<Account> results = query.list(); if (!results.iterator().hasNext()) return null; return results.iterator