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

Ask Your Question
0

Query with restrictions on parent's parent object.

Hi,

I'm trying to do a query using SQLQuery where I have a restriction on the template object I'm passing as an argument.

Query code looks like this:

{code} MyObjectGrandParent grandParent = new MyObjectGrandParent(); grandParent.setSomeValue(42);

MyObjectParent parent = new MyObjectParent(); parent.setGrandParent(grandParent);

MyObject qTemplate = new MyObject(); qTemplate.setParent(parent); qTemplate.setSomeOtherField("blah");

SQLQuery sqlQuery = new SQLQuery(qTemplate, "someOtherField = ? AND parent.grandParent.someValue = ?"); {code}

And I have also tried:

{code} SQLQuery sqlQuery = new SQLQuery(qTemplate, "someOtherField = ? AND parent.grandParent = ?"); {code}

But It just doesn't seem to work this way. When I add a restriction to MyObjectParent as well, then it works :? . But I don't want that since there may be multiple of those that match my search...

Any ideas?

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

asked 2007-06-04 10:15:03 -0500

martijn gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

By the way, when using 'parent.grandParent.someValue = ?' I get the following exception: {quote}SEVERE [com.gigaspaces.persistent]: ExternalEntry field was not part of metadata fieldname=someValue{quote} when using 'parent.grandParent = ?' I get the following exception: {quote}SEVERE [com.gigaspaces.persistent]: ExternalEntry field was not part of metadata fieldname=grandParent{quote} And when using 'parent = ?' I get no exceptions ... and no results :(

answered 2007-06-05 09:07:02 -0500

martijn gravatar image
edit flag offensive delete link more

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

Stats

Asked: 2007-06-04 10:15:03 -0500

Seen: 22 times

Last updated: Jun 05 '07