JBoss Community

Re: hibernate.cfg.xml not found (JBPM5 / Install.demo)

created by Touil Imad in jBPM - View the full discussion

Demain,

 

I have Jbpm5 with jBoss 7 well configured, right now i'm trying to excute a query that will Insert "a simple row" in my database table "users".

 

Here is my code with JPA :

 

EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

EntityManager em = emf.createEntityManager();

Query query = em.createQuery("SELECT c FROM users c");

List results = query.getResultList();

System.out.println(results);

 

When i run this i get this error :

 

java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: users is not mapped [SELECT c FROM users c]

          at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:601)

          at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:96)

          at com.sample.ProcessTest.testProcess(ProcessTest.java:46)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

  ...

 

I'm confused now i'm Using JPA but i get  org.hibernate.hql.ast.QuerySyntaxException: users is not mapped Error.

 

 

Hope that thinsg get clear for you now.

 

And i really appreciate your help. Thank you in advance.

Reply to this message by going to Community

Start a new discussion in jBPM at Community