Spring + jpa + hibernate, listing all rows in a table

I'd like to read all values of rows, from the table Person in a db. I think the configuration persistence.xml and Entry.java (entity) is correct. If needed I will post them. Anyway my code doesn't work:

@Override
public List<Entry> list() {
    List<Entry> res = entityManager.createQuery("SELECT * FROM Person", Entry.class).getResultList();

    return res;
}

log says:

org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [SELECT * FROM Person]

any idea ?

ok. Without SELECT * logs tell me:

org.hibernate.hql.internal.ast.QuerySyntaxException: Person is not mapped [FROM Person]

solved. The solution is :

List<Entry> res = entityManager.createQuery("FROM Entry").getResultList();

Where "Entry" is the entity and not the table.

You need to remove the SELECT * part from the query:

List<Entry> res = entityManager.createQuery("from Person", Entry.class).getResultList();

JBoss JPA/Hibernate Tutorial