jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alarcher <antoinelarc...@gmail.com>
Subject Re: OCM QueryManager - Results objects
Date Mon, 22 Dec 2008 13:41:53 GMT

Thanks a lot Todd.

AL

Todd Seiber wrote:
> 
> Add a bean to the Property3 class to hold the parent object. Now create an
> object which extends AbstractBeanConverterImpl. In the getObject method
> get
> the parent (i.e. parentNode.getParent()). In your OCM definition map this
> bean object using converter="x.y.z.YourAbstractBeanConverterImpl"
> 
> On Mon, Dec 22, 2008 at 5:48 AM, alarcher <antoinelarcher@gmail.com>
> wrote:
> 
>>
>> Hi,
>>
>> I'm using OCM QueryManager in a node structure like this :
>>
>> * Parent1
>>   - Property1
>>   - Property2
>>   * Property3 (it's a @Bean field)
>>      - Property11
>>      - Property12
>>
>> I wonder if there's a way to retrieve "Parent1" object while filtering on
>> Property11 of the Bean Property3 ?
>>
>> What I do is :
>>
>>        org.apache.jackrabbit.ocm.query.QueryManager mgr =
>> ocm.getQueryManager();
>>        Filter filter = mgr.createFilter(Property3.class);
>>        filter.addLike("Property11", "...");
>>
>>        org.apache.jackrabbit.ocm.query.Query query =
>> mgr.createQuery(filter);
>>        Collection results = ocm.getObjects(query);
>>
>> Inevitably, the results are of type "Property3".
>>
>> Do you know if there is a way that ocm.getObjects returns parent objects
>> ?
>>
>>
>> Thanks very much,
>>
>> Regards,
>>
>> Antoine Larcher
>> --
>> View this message in context:
>> http://www.nabble.com/OCM-QueryManager---Results-objects-tp21125828p21125828.html
>> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Todd Seiber
> 830 Fishing Creek Rd.
> New Cumberland, PA 17070
> 
> h. 717-938-5778
> c. 717-497-1742
> e. todd.seiber@gmail.com
> 
> 

-- 
View this message in context: http://www.nabble.com/OCM-QueryManager---Results-objects-tp21125828p21127990.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message