Hibernation Query for Database List

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

Hibernation Query for Database List

Sascha Österle
Hi,

I have a class with a database list property that should list all
available users but I got no idea how the hibernation query should look.

Thanks!
Sascha





--
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: Hibernation Query for Database List

jeremi joslin
On 1/16/06, Sascha Österle <[hidden email]> wrote:
> Hi,
>
> I have a class with a database list property that should list all
> available users but I got no idea how the hibernation query should look.
>
> Thanks!
> Sascha
Hi,

select prop.value from BaseObject as obj, StringProperty as prop where
obj.className='XWiki.CompanyClass' and prop.id.id = obj.id and
prop.id.name='name' order by prop.value

replace "XWiki.CompanyClass" by your the className of the class who
contains the list of users and 'name' by the column name

Jérémi


--
Blog: http://www.jeremi.info
LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
http://www.xwiki.org
skype: jeremi23 -- msn et gtalk : [hidden email]



--
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: Hibernation Query for Database List

Sascha Österle
Hi,

wow, it works! I had to change the ClassSheet to use
    #set($obj = $doc.getObject("XWiki.TodoClass",0))
and
    $doc.display($prop.getName(),"edit",$obj)
instead of just
    $doc.display($prop.getName())

Now one last question:
    Can I select multiple columns too? I would love to have the
first_name and last_name in my drop-down.

Thanks a lot!
Sascha

jeremi joslin wrote:

> On 1/16/06, Sascha Österle <[hidden email]> wrote:
>  
>> Hi,
>>
>> I have a class with a database list property that should list all
>> available users but I got no idea how the hibernation query should look.
>>
>> Thanks!
>> Sascha
>>    
> Hi,
>
> select prop.value from BaseObject as obj, StringProperty as prop where
> obj.className='XWiki.CompanyClass' and prop.id.id = obj.id and
> prop.id.name='name' order by prop.value
>
> replace "XWiki.CompanyClass" by your the className of the class who
> contains the list of users and 'name' by the column name
>
> Jérémi
>
>
> --
> Blog: http://www.jeremi.info
> LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1437724
> http://www.xwiki.org
> skype: jeremi23 -- msn et gtalk : [hidden email]
>
>  
> ------------------------------------------------------------------------
>
>
> --
> 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
>  



--
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