jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristof Taveirne <kristof.tavei...@gmail.com>
Subject How to Filter on a Collection
Date Sat, 15 Aug 2009 18:38:45 GMT

I'm just starting out using jackrabbit and I'm running into something that's
probably a newbie question but anyway here I go.

I'm using OCM and I have this class which represents some content.
The content also has some metadata which is stored in List of MetaData
MetaData object is a Key/Value pair.

This list is annotated with the @Collection annotation.

I want to search this content based on some properties but then I want to
select the apropriate version of the content.
For example "Show content about X but with language="ENGLISH" AND

This would return English content with images that is OK to show to
language and childproof are NOT fields in the Content object but are keys in
MetaData objects.

Here is the structure of my class
  - code
  - title
  - subtitle
  - text
  - image
  - meta
    - metaData ( key: lang, value: "EN")
    - metaData ( key: childproof, value: "true")

code represents an identifier for the content. this means the dutch version
and the english version have the same code.
I know the code, and I want to filter out the childproof english version.

filter.addEqualTo("code","1F3CDX4") ... that was easy

I would like to do the query on repository level, but ofcourse I could just
fetch all Content objects with that code, and filter manually ....

Can somebody help me with this?



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message