This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155219

Summary: Certain subselect queries doesn't work in the HQL Editor
Product: javaee Reporter: Jan Horvath <jhorvath>
Component: HibernateAssignee: Vadiraj Deshpande <vadirajvd>
Status: VERIFIED FIXED    
Severity: blocker CC: mschovanek, sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log file

Description Jan Horvath 2008-12-11 12:11:51 UTC
I'm not able to run a query with subselect in the HQL Editor. Sakila db is used here:

from Actor as actor where actor.actorId in (select filmActor.actor.actorId from FilmActor as filmActor where filmActor.film.filmId=20)

However another query works fine:

from Actor as actor where (select count(f.film) from actor.filmActors as f) > 10
Comment 1 Vadiraj Deshpande 2008-12-12 06:19:14 UTC
Reproducible in latest build. May be this is due error in pre-processing of mapping files. Here's the exception :
org.hibernate.DuplicateMappingException: Duplicate collection role mapping sakila.Actor.filmActors
        at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2066)
        at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2041)
        at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:359)
        at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:273)
        at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:144)
        at org.hibernate.cfg.Configuration.add(Configuration.java:669)
Comment 2 Vadiraj Deshpande 2008-12-12 06:21:17 UTC
Created attachment 74876 [details]
IDE log file
Comment 3 Vadiraj Deshpande 2008-12-12 09:47:31 UTC
Fixed:
http://hg.netbeans.org/main/rev/4b3db7cb6d4e
Comment 4 Jan Horvath 2008-12-12 12:10:40 UTC
v.
Comment 5 Vadiraj Deshpande 2008-12-13 17:24:51 UTC
Adjusting the target milestone.
Comment 6 pslechta 2008-12-16 14:19:47 UTC
The fix was ported into release65_fixes repository.

http://hg.netbeans.org/release65_fixes/rev/2765bf2480e3