Hello,
I have The collection was unreferenced
my code :
Code:
query = session.getNamedQuery(ShipmentDAO.QUERY_ALL_SHIPMENT);
query.setFirstResult(startRecord);
query.setMaxResults(endRecord);
List results = query.list();
query = session.createFilter(results,"order by date asc");
return query.list();
my name query :
Code:
@NamedQuery(
name = ShipmentDAO.QUERY_ALL_SHIPMENT,
queryString="from Shipment shipment left join fetch shipment.pieces"
)
the session.createFilter line of code throws the exception.
Is it a bug ? or something that I don't understand
Hibernate version: 3.1
Full stack trace of any exception that occurs:
The collection was unreferenced
org.hibernate.QueryException: The collection was unreferenced
at org.hibernate.impl.SessionImpl.getFilterQueryPlan(SessionImpl.java:1369)
at org.hibernate.impl.SessionImpl.createFilter(SessionImpl.java:1191)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:292)
at $Proxy16.createFilter(Unknown Source)
at com.tigatech.dhl.dao.hibernate.ShipmentDAOHibernate.getAllShipments(ShipmentDAOHibernate.java:78)
at com.tigatech.dhl.test.junit.ShipmentTest.testGetShipmentList(ShipmentTest.java:117)
at com.tigatech.dhl.test.junit.HibernateTest.runTest(HibernateTest.java:48)
thank you