Hi! mbryant wrote: > I am trying to create a query to populate an attribute of an object with all > the “Name” (an attribute of another object) . > > I seem to have run into an issue, in which I created a special space > (CustomClass) to house all my User defined classes. > > I can’t seem to build a query to access that space. > > I have tried to normal default query that I found which worked was: > > select doc.fullName from XWikiDocument doc > > this of course returns all the documents in the wiki. > > Is there a way that I can get all the pages listed in a specific space and > not just the XWiki default space (I assume I should be able to do this),
#set($hql = "where doc.space='YourSpace') > and > if I can do this, how can I query an instance of a class (Foo) that lives in > the CustomClass > Do you mean querying instances of a class instantiate in a given document? I think many examples in... http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples ... apply to your situation. If you want to get all objects of a given class: http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples#HGettingobjectsofaspecificclass If you want to query properties on that objects: http://platform.xwiki.org/xwiki/bin/view/DevGuide/velocityHqlExamples#HGettingobjects27properties I can't help with the update part of your question. But I think I would be better if you get the select clause working first! > I have tried and several permutations of the following query. I am hitting > my head against a wall and all help would be greatly appreciated. Things > that have been unsucessfull, Xwiki.CustomClass.Foo, Foo itself, the modifier > seen below, I am at a loss on how to currently approach this. > > select foo.Name from CustomClass.Foo foo > > > I am new to HQL, and while I have read up, it has not quite yet solved my > problem in dealing with this XWiki problem. It is important to note that I > have also taken the query out and used the feiled for Class, and Value but > that also did not work. Advice? > > Thank you > > Martin Bryant > Modus Operandi > HTH. If it doesn't, don't hesitate to be more specific and I'll try to help! I'm learning HQL myself! :-) Greetings! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
