Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Filtering data on DefaultHibernateExternalDataSource initialLoad


I was wondering the best practices to filtering data on an initialLoad for an external data source. Currently I create my own DataIterator<> that is returned from the initialLoad call. However, this requires me to run the super.initalLoad first and iterator over the class that I want to filter from the results and instantiate my DataIterator<> with the subset of data I want to load in the space. This works, but it still requires me to pull everything in a weed out what I don't want. What I would rather do is just create a SQLQuery that the default initialLoad can use so I only pull in the data i want. Looking at the DefaultHibernateExternalDataSource documentation, a method called iterator(com.j_spaces.core.client.SQLQuery sqlQuery) exists that looks like it will do what I want to do but it seems to not get called when the initialLoad happens. Is this the correct method and perhaps I am doing something wrong or is there a better way to do this.



{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3841]{quote}

asked 2012-03-16 11:29:42 -0500

rchristy's avatar

updated 2013-08-08 09:52:00 -0500

jaissefsfex's avatar
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Take a look at:

See also:


answered 2012-03-16 17:54:27 -0500

shay hassidim's avatar
edit flag offensive delete link more



This work perfectly thank you. I ended up calling super.initialLoad to load classes I didn't want to filter and provided SQLQuery for the special cases. At the end I was able to merge all the results.



rchristy's avatar rchristy  ( 2012-03-20 12:43:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-03-16 11:29:42 -0500

Seen: 157 times

Last updated: Mar 16 '12