Illegal attempt « Collection « JPA Q&A

1. HQL: illegal attempt to dereference collection

The situation is like this: I have an entity Book that holds a one-to-many relationship with Chapter. Now if I try the query, "from Book book inner join book.chapters chapter where chapter.title like ...

3. HQL: illegal attempt to dereference collection

4. illegal attempt to dereference collection

Newbie Joined: Thu May 18, 2006 1:46 pm Posts: 10 Hibernate version: 3.2.3 Entity Manager version: 3.3.1 Hibernate Annotations version: 3.3.0 Hello there! I'm porting an already functional project using Hibernate 3.1 and SessionFactory to a JPA approach. After changing all my xdoclets annotations to my new JPA annotations, one query is not working anymore. It's a many-to-many bi-directional relationship. Here's ...

5. illegal attempt to dereference collection

6. QueryException:illegal attempt to dereference collection

i get the following exception : Error in named query: getZonePanelItems org.hibernate.QueryException: illegal attempt to dereference collection [vecltypzon1_.PK_VECLTYP_ZONE_PANEL.panelItems] with element property reference [lookup] [ from com.manheim.icheck.domain.Lookup lu,com.manheim.icheck.domain.VecltypZonePanel vzp where lu.pkLookup in vzp.panelItems.lookup and vzp.vehicleType.pkVehicleType = :vehTypeId and vzp.lookupByFkZoneKey.pkLookup = :zoneId and vzp.lookupByFkPanelKey.pkLookup = :panelId ] when i try to execute the following query:

7. illegal attempt to dereference collection

Hello everyone, I have three classes: Department, County, and Zipcode. Each Department is mapped to a set of counties that are associated with it, and each County has a set of mapped Zipcodes. I am having difficulty getting a Department by Zipcode. The following HQL gives an error: from Department as h where = (select from County as c ...