-->
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.  [ 1 post ] 
Author Message
 Post subject: Filter & Aggregration, pass from 1 process to another in
PostPosted: Wed Jun 13, 2007 3:40 am 
Newbie

Joined: Wed Jun 13, 2007 3:28 am
Posts: 1
I need to perform Filter & aggregration based on set of collections objects (whether they are linked to each other or not in hbm setting) such as flow below:

1. Process1 loads records from DB to memory (i.e. session.createCriteria(object.getClass()).list())
2. Process1 performs some filtering and pass to Process2
3. Process2 performs another set of filtering and aggregration and pass to process 3
4. and so on and so on, which can be dynamically configured throug a configuration file till the final result will be persistent back to DB.

I have thought of using declarative <filter> or Criteria in Hibernate, but as far as I know, both of this approach will not be able to address the requirement by considering such dynamic process that is declarative.

One feature that I can think of in Hibernate is: createFilter(), however always hit this weird problem :
"org.hibernate.QueryException: The collection was unreferenced"

A simple example:
<hibernate-mapping>
<class name="Person" table="person">
<id name="id" type="java.lang.Long">
<generator class="assigned"/>
</id>
<property name="name" type="string">
<column name="name" length="12" />
</property>
<property name="age" type="long">
<column name="age" />
</property>
<property name="city" type="string">
<column name="city"/>
</property>
</class>
</hibernate-mapping>

By following above mentioned flow:
1. List persons = session.createCriteria(person.getClass()).list(); --> succesfully loaded to memory
2. List results = session.createFilter(persons, " where this.age < 30").list; --> failed, error msg: "org.hibernate.QueryException: The collection was unreferenced""

anyone has solution for this ?
Looks like my resolution will have to use Hypersonic SQL which provide so called "query in memory" feature.

Thanks.

sunento


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

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.