-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: filtering always throws QueryException: The collection was u
PostPosted: Sun Feb 15, 2004 10:55 pm 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
I query, get a List of results, then (try to) filter those results. This always produces:

[java] net.sf.hibernate.QueryException: The collection was unreferenced
[java] at net.sf.hibernate.impl.SessionImpl.getFilterTranslator(SessionImpl.java:3408)
[java] at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3471)
[java] at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3366)
[java] at com.publishworks.merchandise.ItemMeta.filterForAttributeName(ItemMeta.java:24)
[java] at com.publishworks.hibernate.test.Test1.ReebokTest(Test1.java:99)
[java] at com.publishworks.hibernate.test.Test1.main(Test1.java:189)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:233)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:170)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:699)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:206)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:115)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
[java] at org.apache.tools.ant.Task.perform(Task.java:401)
[java] at org.apache.tools.ant.Target.execute(Target.java:338)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:365)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:669)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:220)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)

Code:
   public static ItemMeta filterForAttributeName(Collection itemMetas, String attribName)
      throws HibernateException
   {
      return (ItemMeta) CollectionUtils.get( HibernateUtil.currentSession().filter(itemMetas,
            "where this.internal=false AND this.attribName=?", attribName, Hibernate.STRING), 0);      
   }

   static List fetchFacets(DataSlice ds) throws HibernateException
   {
      return HibernateUtil.currentSession()
         .find("select from ItemMeta as im where im.indexed=true AND im.dataSlice=?",
         ds, Hibernate.entity(DataSlice.class));
   }

   public static void main(String[] args) throws HibernateException, SQLException
   {
      Collection facets = ds.getItemFacets();
      ItemMeta sectionFacet = ItemMeta.filterForAttributeName(facets, "fts_category");
   }


Am I calling this wrong? Is this a known bug? Is there a work-around?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 15, 2004 11:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
http://hibernate.org/117.html#A10


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.