Thanks, code checked, made some improvements.
But the query should recognize that both class attributes are of type DBLIST.
the question is how I should specify the where clause:
so
where dblist_property1 = :bindvalue1 and dblist_property2 = :bindvalue2
What should we put in our two bindvalue's ?
a string: 'text'
a array: ['text']
a object {text}
Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<[email protected]>
________________________________
From: users <[email protected]> on behalf of Guillaume Delhumeau
<[email protected]>
Sent: 28 September 2016 12:12:16
To: XWiki Users
Subject: Re: [xwiki-users] XWQL datatype question
Hi.
Note that this line:
#set( $qParticipations = "from doc.object('$participationClassName') as
participation where doc.fullName <> 'waihonapediaResearchParticipationTemplate'
and participation.research = :thisresearch" and participation.family =
:thisUser)
is invalid (you closed the " too soon). But I guess it's not your problem.
Also, I really doubt that you have a page called
'waihonapediaResearchParticipationTemplate' (it's supposed to be a
fullname).
There is also invalid simple quotes (') in doc.object.
So the correct query should be:
#set( $qParticipations = "from doc.object(WaihonaCode.
waihonapediaResearchParticipationClass) as participation where doc.fullName
<> 'WaihonaCode.waihonapediaResearchParticipationTemplate' and
participation.research = :thisresearch and participation.family =
:thisUser")
I hope it helps,
2016-09-27 14:03 GMT+02:00 Gerritjan Koekkoek <[email protected]>:
> Hi,
>
>
> I have this class:
>
> #set( $participationClassName = "WaihonaCode.
> waihonapediaResearchParticipationClass" )
>
>
> Class properties
>
> researchparticipation.family (family: List of Users)
>
> researchparticipation.research (research: Database List)
>
> researchparticipation.participate (participate: Boolean)
>
> researchparticipation.datasend (datasend: Boolean)
>
>
>
> I have this XWQL:
>
>
> #set( $qParticipations = "from doc.object('$participationClassName') as
> participation where doc.fullName <>
> 'waihonapediaResearchParticipationTemplate'
> and participation.research = :thisresearch" and participation.family =
> :thisUser)
>
>
> I'm getting velocity error:
>
> Caused by: org.hibernate.QueryException: could not resolve property:
> research of: com.xpn.xwiki.objects.BaseObject [ select doc.fullName from
> com.xpn.xwiki.doc.XWikiDocument as doc , com.xpn.xwiki.objects.BaseObject
> as participation where
>
>
> When doing similar on a class where class properties are of type string I
> have no Issues?
>
> What should I do with these properties: List of Users (always only 1) and
> Database List (always only 1)?
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website<http://www.cdlsworld.org>
> Facebook<https://www.facebook.com/gerritjan.koekkoek>
> email<[email protected]>
>
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>
--
Guillaume Delhumeau ([email protected])
Research & Development Engineer at XWiki SAS
Committer on the XWiki.org project
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users