Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 136996 - org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="org.netbeans.test.entity.Testsuite"/>
org.hibernate.MappingException: An AnnotationConfiguration instance is requir...
Product: javaee
Classification: Unclassified
Component: Hibernate
All All
: P1 (vote)
Assigned To: Vadiraj Deshpande
: 141470 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2008-06-11 14:33 UTC by Jan Horvath
Modified: 2008-11-24 12:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Horvath 2008-06-11 14:33:25 UTC
I'm not able to run a query on annotated classes.

Build: NetBeans IDE Dev (Build 080611)
VM: Java HotSpot(TM) Client VM, 1.5.0_13-119, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-237
OS: Mac OS X, 10.5.3, i386
User comments: ran a query on annotated class
STACKTRACE: (first 10 lines)
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="org.netbeans.test.entity.Testsuite"/>
        at org.hibernate.cfg.Configuration.parseMappingElement(
        at org.hibernate.cfg.Configuration.parseSessionFactory(
        at org.hibernate.cfg.Configuration.doConfigure(
        at org.hibernate.cfg.Configuration.doConfigure(
        at org.hibernate.cfg.Configuration.configure(
        at org.netbeans.modules.hibernate.hqleditor.HQLExecutor.execute(
        at org.netbeans.modules.hibernate.hqleditor.HQLEditorController$
Comment 1 Vadiraj Deshpande 2008-06-13 06:23:57 UTC
AnnotationConfiguration is yet to be supported.
Comment 2 Vadiraj Deshpande 2008-07-17 09:02:55 UTC
Fix : Use AnnotationConfiguration instead of Configuration.
Comment 3 exceptions 2008-07-23 21:46:43 UTC
This issue blocks HQL from using with Annotated classes and should be fixed for Beta
Comment 4 Vadiraj Deshpande 2008-07-26 19:34:16 UTC
Initial fix:
Comment 5 Vadiraj Deshpande 2008-07-28 23:02:39 UTC
*** Issue 141470 has been marked as a duplicate of this issue. ***
Comment 6 Vadiraj Deshpande 2008-08-04 17:08:40 UTC
Fixed (with workaround)

Comment 7 Jayashri Visvanathan 2008-08-04 19:32:11 UTC
  Can you please verify the issue so that we can check into branch. Please also add the keyword once you have verified.
Comment 8 Jan Horvath 2008-08-05 15:41:52 UTC
I was able to run a query only on fresh project with entity classes generated by rev.eng. from the sample db. 
When I was trying HQL editor on my existing project with entity classes generated by Entity Classes from DB it was no successful. I've got an exception:

org.hibernate.hql.ast.QuerySyntaxException: Testsuite is not mapped [select t from Testsuite t]
	at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(
	at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(
	at org.hibernate.hql.ast.tree.FromClause.addFromElement(
Comment 9 Vadiraj Deshpande 2008-08-08 01:27:13 UTC
That exception is due to the reason of using related Entities in the query.
Now HQL Editor supports related entities (OneToMany, ManyToMany etc...).

Please reverify.
Comment 10 Jan Horvath 2008-08-08 17:02:57 UTC
I was not successful with query on the entity with a relationship.

org.hibernate.AnnotationException: @OneToOne or @ManyToOne on org.netbeans.test.entity.Testsuite.hostname references an unknown entity: 
	at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(
	at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(
	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(
	at org.hibernate.cfg.Configuration.buildSessionFactory(
	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(
	at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.getHibernateSessionFactoryForThisContext(
	at org.netbeans.modules.hibernate.hqleditor.HQLEditorController.processAndConstructSessionFactory(
	at org.netbeans.modules.hibernate.hqleditor.HQLEditorController$

Comment 11 Vadiraj Deshpande 2008-08-08 17:52:16 UTC
Can you please attach the IDE log also ?
Comment 12 Vadiraj Deshpande 2008-08-19 21:01:00 UTC
Fixed remaining issues:
Comment 13 martin_zmrhal 2008-11-24 12:21:22 UTC

Product Version: NetBeans IDE Dev (Build 200811240201)
Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15
System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo