It's all about the answers!

Ask a question

How to use query model on helper items


Vibha Sinha (1643610) | asked Aug 01 '08, 6:43 a.m.
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

3 answers



permanent link
Matt Lavin (2.7k2) | answered Aug 01 '08, 7:38 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
'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

permanent link
Vibha Sinha (1643610) | answered Aug 01 '08, 10:27 a.m.
Hi

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

Thanks

permanent link
Balaji Krish (1.8k12) | answered Aug 01 '08, 11:04 a.m.
JAZZ DEVELOPER
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

Your answer


Register or 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.