jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurz Wolfgang <wolfgang.k...@gwvs.de>
Subject AW: OCM Search problem
Date Mon, 26 Jan 2009 13:56:50 GMT
Oh i forgot to post the error i get using XPath with ocm:

org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException: Node 
type: nt:unstructured has no descriptor.
    at 
org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescriptorByNodeType(AbstractMapperImpl.java:188)
    at 
org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.getObject(ObjectConverterImpl.java:293)
    at 
org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.getObjects(ObjectContentManagerImpl.java:622)



-----Urspr√ľngliche Nachricht-----
Von: Kurz Wolfgang [mailto:wolfgang.kurz@gwvs.de] 
Gesendet: Montag, 26. Januar 2009 14:12
An: users@jackrabbit.apache.org
Betreff: AW: OCM Search problem

Thats what i thought too.

This is the Query I came up with:

//*[(@" + PROP_MENUID + "= '" + menuId + "')]/parent::*

But since ocm is done with xPath in the background too I thought I could somehow get this
query with ocm too.



-----Urspr√ľngliche Nachricht-----
Von: Todd Seiber [mailto:todd.seiber@gmail.com] 
Gesendet: Montag, 26. Januar 2009 14:03
An: users@jackrabbit.apache.org
Betreff: Re: OCM Search problem

I believe that your only choice will be to use XPATH. The filter would be
for properties but your menuIds are being stored as nodes.


On Mon, Jan 26, 2009 at 4:30 AM, Kurz Wolfgang <wolfgang.kurz@gwvs.de>wrote:

> Hi everyone,
>
> I am useing OCM to store things in Jackrabbit.
>
> I have a problem building my filter:
>
> My Class is called JCR Content and looks something like this:
>
> @Node
> public class JCRContent implements Serializable {
>
>
>        /**
>         * Reference to the unique ContentId
>         */
>        @Field(uuid=true)
>        private String uuid;
>
>        /**
>         * Reference to the Kategories/MenuIds of a Content object
>         */
>        @Collection(elementClassName = MenuId.class)
>        private List<MenuId> menuIds;
>
>        /**
>         * Path of the Content Entry in Jackrabbit
>         */
>        @Field(path=true)
>        private String path;
> }
>
> Now my problems is that I only want objects with a certain menuId returned.
>
> I tried this but it wont work :
>
> ObjectContentManager ocm = ocmFactory.createObjectContentManager();
>
> org.apache.jackrabbit.ocm.query.QueryManager queryManager =
> ocm.getQueryManager();
>
> Filter filter = queryManager.createFilter(JCRContent.class);
>
> filter.addEqualTo("menuid", "1067");
>
> Can anyone please give me ahint on how I would do this query?
>
> Thx a lot in advance!
>
>
>


-- 
Todd Seiber
830 Fishing Creek Rd.
New Cumberland, PA 17070

h. 717-938-5778
c. 717-497-1742
e. todd.seiber@gmail.com

Mime
View raw message