I definitely have a multi select -- in this particular scenario the "recommended" property can have 0-3 fields set, and I only want to choose those items which have it set to "Distributed". If I do the following query:

#set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='ReleaseInfo.BuildStatus'")

I get the list of all ReleaseInfo.BuildStatus classes, which makes sense. But when I add the next clause

#set ($sql = ", BaseObject as obj, DBStringListProperty as prop join prop.list list where obj.name=doc.fullName and obj.className='ReleaseInfo.BuildStatus' and obj.id=prop.id.id")

I get 0 results. Why would that be?

shawn.

Ludovic Dubost <ludovic@xwiki.com> wrote on 08/17/2005 05:13:18 PM:

>
> Actually even with a static list it is a DBStringListProperty.
> StringListProperty is there to store multi selects in one big text
> fields instead of separate rows in the database.
> I believe you are not getting results for another reason. Are you sure
> you are using multiple selects ? Because if you are not, then it is a
> StringProperty and the query should be written a little differently.
>
> Ludovic
>
> lauzon@us.ibm.com wrote:
> > I see the Blog code has an example to search on a
> DBStringListProperty, but I have a static list, which I believe is a
> StringListProperty. If I try to use the following SQL:
> >
> > #set ($sql = ", BaseObject as obj, StringListProperty as prop join
> prop.list list where obj.name=doc.fullName and obj.
> className='ReleaseInfo.BuildStatus' and obj.id=prop.id.id and prop.
> id.name='recommended' and list='Distributed' order by doc.creationDate desc")
> >
> > I get the following error:
> >
> > Wrapped Exception: could not resolve property: list of: com.xpn.
> xwiki.objects.StringListProperty select distinct doc.web, doc.name,
> doc.creationDate  from com.xpn.xwiki.doc.XWikiDocument as doc , com.
> xpn.xwiki.objects.BaseObject as obj, com.xpn.xwiki.objects.
> StringListProperty as prop join prop.list list where obj.name=doc.
> fullName and obj.className='ReleaseInfo.BuildStatus' and obj.
> id=prop.id.id and prop.id.name='recommended' and list='Distributed'
> order by doc.creationDate desc?
> >
> > It seems like it should work ok, so I don't know why I'm getting
> that error. If I simply change StringListProperty to
> DBStringListProperty I don't get an error, but also I don't get any
> results. I can change to using a DBStringListProperty if that's the
> only way to do it, but I'd like to keep it as it is if at all
> possible. Thanks ...
> >
> > shawn.
> >
> >  
> > ------------------------------------------------------------------------
> >
> >
> > --
> > You receive this message as a subscriber of the xwiki-
> users@objectweb.org mailing list.
> > To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> > For general help: mailto:sympa@objectweb.org?subject=help
> > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
> >  
>
>
> --
> Ludovic Dubost
> XPertNet: http://www.xpertnet.fr/
> Blog: http://www.ludovic.org/blog/
> XWiki: http://www.xwiki.com
> Skype: ldubost AIM: nvludo Yahoo: ludovic
>
>
>
> --
> You receive this message as a subscriber of the xwiki-
> users@objectweb.org mailing list.
> To unsubscribe: mailto:xwiki-users-unsubscribe@objectweb.org
> For general help: mailto:sympa@objectweb.org?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws