-
Notifications
You must be signed in to change notification settings - Fork 300
Open
Description
Hello @cschneider ,
I tried your project db-examplejpa which works fine (I have just link this example with a Oracle DB instead of H2 DB). I can add, list and delete persons.
For the "list" action, I tried to rewrite the query to use the Criteria API as follow:
public List<Person> getAll() {
final CriteriaBuilder builder = em.getCriteriaBuilder();
final CriteriaQuery<Person> criteria = builder.createQuery(Person.class);
final Root<Person> personRoot = criteria.from(Person.class);
criteria.select(personRoot);
final TypedQuery<Person> query = em.createQuery(criteria);
final List<Person> people = query.getResultList();
return people;
// return em.createQuery("select p from Person p",
// Person.class).getResultList();
}
But I have the following error:
karaf@root>person:list
Error executing command: Not an entity: class net.lr.tutorial.karaf.db.examplejpa.Person
Do you have an idea why?
I am using Karaf 4.0.9.
Thanks a lot.
Metadata
Metadata
Assignees
Labels
No labels