Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to use query model on helper items

Hi,

I am extending the Jazz provided repository with my own data model.

I need to query on certain attributes which have been marked as queryable in a helper data item. However, how do I initialize the QueryModel in such a case.

For SimpleTypes, I have been using:
<Item>QueryModel.<Item>QueryModel.ROOT

However, in the query model generated for helper items, I do not get the ROOT attribute

Thanks
- Vibha

0 votes



3 answers

Permanent link
'Helper' models are, by definition, not root level Items. You can only
store a Helper model by attaching it to an Item, and you can only query
for it by starting at an <Item>QueryModel.ROOT and traversing a
queryable path to the helper.

vssinha wrote:
Hi,

I am extending the Jazz provided repository with my own data model.

I need to query on certain attributes which have been marked as
queryable in a helper data item. However, how do I initialize the
QueryModel in such a case.

For SimpleTypes, I have been using:
Item>QueryModel.<Item>QueryModel.ROOT

However, in the query model generated for helper items, I do not get
the ROOT attribute

Thanks
- Vibha

0 votes


Permanent link
Hi

Pardon my ignorance, but would it be possible to get an example of how to traverse a queryable path to the helper ?

Thanks

0 votes


Permanent link
If ItemA has a HelperB that has a queryable attribute c, you can do the
following (Note that you can traverse a helper only from an item that owns
it)..

ItemAQueryModel x = ItemAQueryModel.ROOT;
IItemQuery q = IItemQuery.FACTORY.newInstance(x);
q.filter(x.helperB().attributeC()._eq(.....)

------- Balaji

"vssinha" <vibha> wrote in message
news:g6v6hg$aeu$1@localhost.localdomain...
Hi

Pardon my ignorance, but would it be possible to get an example of how
to traverse a queryable path to the helper ?

Thanks

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Aug 01 '08, 6:43 a.m.

Question was seen: 5,545 times

Last updated: Aug 01 '08, 6:43 a.m.

Confirmation Cancel Confirm