Search on StringListProperty

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Search on StringListProperty

Shawn Lauzon
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 [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Search on StringListProperty

Ludovic Dubost

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

[hidden email] 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 [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?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 [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Search on StringListProperty

Shawn Lauzon

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 <[hidden email]> 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
>
> [hidden email] 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-
> [hidden email] mailing list.
> > To unsubscribe: mailto:[hidden email]
> > For general help: mailto:[hidden email]?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-
> [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Search on StringListProperty

Ludovic Dubost

It's difficult to help without actually have the details of the classes
and what data actually is in the database.
You can turn on sql debugging in log4j.properties and check the sql
query generated and see what it does and why there is no data.
Maybe the data is not where you think it is.. In which data is the
'Distributed' data

Ludovic

Shawn Lauzon wrote:

>
> 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 <[hidden email]> 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
> >
> > [hidden email] 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-
> > [hidden email] mailing list.
> > > To unsubscribe: mailto:[hidden email]
> > > For general help: mailto:[hidden email]?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-
> > [hidden email] mailing list.
> > To unsubscribe: mailto:[hidden email]
> > For general help: mailto:[hidden email]?subject=help
> > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?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 [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws