-
15. Re: NamedQuery problem: TABLE is not mapped
danwin Sep 2, 2010 9:11 AM (in response to wolfgangknauf)I have installed J2EE SDK 6 and switched the JAVA_HOME variable to its jdk folder.
Still I get the Table is not mapped message ;(
But maybe I forgot to tell something important. The select statement gets executed successfully anyway. I.e. on the webpage I get content displayed from the employee table.
Log:
2010-09-02 14:25:13,463 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] (http-127.0.0.1-8080-1) parse() - HQL: select e from EmployeeEntity e
2010-09-02 14:25:13,463 DEBUG [org.hibernate.hql.ast.AST] (http-127.0.0.1-8080-1) --- HQL AST ---
\-[QUERY] 'query'
\-[SELECT_FROM] 'SELECT_FROM'
+-[FROM] 'from'
| \-[RANGE] 'RANGE'
| +-[IDENT] 'EmployeeEntity'
| \-[ALIAS] 'e'
\-[SELECT] 'select'
\-[IDENT] 'e'2010-09-02 14:25:13,463 DEBUG [org.hibernate.hql.ast.ErrorCounter] (http-127.0.0.1-8080-1) throwQueryException() : no errors
2010-09-02 14:25:13,463 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] (http-127.0.0.1-8080-1) select << begin [level=1, statement=select]
2010-09-02 14:25:13,463 INFO [STDOUT] (http-127.0.0.1-8080-1) org.hibernate.hql.ast.QuerySyntaxException: EmployeeEntity is not mapped [select e from EmployeeEntity e]Thx,
Daniel
-
16. Re: NamedQuery problem: TABLE is not mapped
wolfgangknauf Sep 3, 2010 9:20 AM (in response to danwin)So you have JBoss 6.0? "J2EE SDK 6" sound like you use the sun app server, but I assume you mean JBoss 6 ;-)?
I fear I cannot provide you with more help, maybe you found a JBoss bug and hopefully one of the developers can comment on this...
Best regards
Wolfgang
-
17. Re: NamedQuery problem: TABLE is not mapped
wdfink Sep 8, 2010 5:41 AM (in response to danwin)Do you see within the logfile during startup that the entity is registered?
I have a similar (unsolved) problem in a different context, using EJB access and the persistence is deployed as a separate JAR file.
-
18. Re: NamedQuery problem: TABLE is not mapped
danwin Sep 9, 2010 11:15 AM (in response to wdfink)Detection of entity and binding to table works ...
2010-09-09 16:47:57,886 DEBUG [org.hibernate.ejb.Ejb3Configuration] (main) Detect class: true; detect hbm: false
2010-09-09 16:47:57,907 INFO [org.hibernate.ejb.Ejb3Configuration] (main) found EJB3 Entity bean: employee.EmployeeEntity
2010-09-09 16:47:57,920 WARN [org.hibernate.ejb.Ejb3Configuration] (main) Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
2010-09-09 16:47:58,005 INFO [org.hibernate.cfg.Configuration] (main) Reading mappings from resource : META-INF/orm.xml
2010-09-09 16:47:58,014 INFO [org.hibernate.ejb.Ejb3Configuration] (main) [PersistenceUnit: Employee-Details] no META-INF/orm.xml found
2010-09-09 16:47:58,019 DEBUG [org.hibernate.cfg.AnnotationConfiguration] (main) Execute first pass mapping processing
2010-09-09 16:47:58,080 DEBUG [org.hibernate.cfg.AnnotationConfiguration] (main) Process hbm files
2010-09-09 16:47:58,080 DEBUG [org.hibernate.cfg.AnnotationConfiguration] (main) Process annotated classes
2010-09-09 16:47:58,086 INFO [org.hibernate.cfg.AnnotationBinder] (main) Binding entity from annotated class: employee.EmployeeEntity
2010-09-09 16:47:58,115 DEBUG [org.hibernate.cfg.Ejb3Column] (main) Binding column DTYPE unique false
2010-09-09 16:47:58,140 DEBUG [org.hibernate.cfg.annotations.EntityBinder] (main) Import with entity name=EmployeeEntity
2010-09-09 16:47:58,145 INFO [org.hibernate.cfg.annotations.EntityBinder] (main) Bind entity employee.EmployeeEntity on table employeeFirst when I execute a hql statement I get the error.
-
19. Re: NamedQuery problem: TABLE is not mapped
jaikiran Sep 10, 2010 11:03 AM (in response to danwin)Are you sure the correct EntityManager is being picked up for running that JPQL?
-
20. Re: NamedQuery problem: TABLE is not mapped
danwin Sep 11, 2010 4:33 AM (in response to jaikiran)Actually, I don't know. I create an EntityManager based on the same persistence.xml ..
EntityManagerFactory emf = Persistence.createEntityManagerFactory("timetracker-persistence");
em = emf.createEntityManager();
EntityTransaction et = em.getTransaction();