Request by String value in list of string with XWQL

Hello,

As mentionned in the title, I have a class which contain as property a list of String and I would like to request in an XWQL document by a value in this list

for exemple in Java

        String statement =
                "from doc.object(MySpace.OIDCClass) as client where client.maintainers LIKE :username";

            List<String> clients = null;
            
            try {
            	
            	String usernameLike = "%"+username+"%";
            	
                clients =
                    this.queryManager.createQuery(statement, Query.XWQL)
                    .bindValue("username", username)
                    .execute();

I also tried with an IN clause where client.maintainers IN (:username)" but it doesn’t really have sense

To simplify I would like some thing like `where client.maintainers CONTAINS (:username)"``

So the property maintainers is a List of string (I’m not using XWikiUser class for some reasons) how could I request for document where one item of the maintainers list contain an occurence of my search (in that case username)

I could consider HQL too, but I don’t really know how the list of string is represented in the database or entities from a xwiki point of view

Maybe the solution and a sample could appears here
https://extensions.xwiki.org/xwiki/bin/view/Extension/Query%20Module

Thanks :slight_smile:

Hello,

A little :up: to this. I hope the question is clear enought I’m starting a new functionality and I will need again to look for some specific entries by one of their value in a list of value (maybe represented by a JOIN internally ?) and it would be very usefull to have an exemple in the doc.

Or maybe there is a limitation and list of string cannot really by requested using some XWQL since they qre probably 2 tables joined in the database ?

My bad, while doing an other tasks I read the doc again and I found the solution.

It was just “member of”

String statement =
        "from doc.object(MySpace.OIDCClass) as client "
        + "where (client.owner = :username OR :username member of client.maintainers)";