ATG RQL query such as SQL property in (x, y, z) '

I am trying to write an RQL query that makes the equivalent of this sql:

select * from some_table t where t.property in (1, 2, 3, 4 ...)

I'm not sure if RQL supports this. There is an example in oracle docs on how to do this in the repository item id property:

ID IN { "0002421", "0002219", "0003244" ... }

but when I try to change the identifier in this example to the property I want to query, I get a RQL ParseException.

Does anyone know if this is possible?

+4
source share
3 answers

this is possible through the querybuilder api (see example below). I'm not sure why this is not available through simple RQL.

QueryExpression thePropertyExpression =     
   theQueryBuilder.createPropertyQueryExpression("postalCode");

String [] zipcodeArray = {"22185", "22183"};

QueryExpression theValueExpression = 
    theQueryBuilder.createConstantQueryExpression(zipcodeArray);

Query theQuery = 
    theQueryBuilder.createIncludesQuery(theValueExpression, thePropertyExpression);
+2
source

ATG RQL ID IN, ID , ParseException.

, ComparisonOperator. INCLUDES ANY.

( )

{ "", "" }

:

( " " ) ( "" )

, .

, , , , , OR, , IN .

0

The answer from radimpe is correct and straight from oracle docs. You can make INCLUDES ANY request for your requirement. It works for strings. E.g. if you are looking for users with a name in Alex or Brian, you can write in RQL:

firstName INCLUDES ANY {"Alex","Brian"}

Link here: http://docs.oracle.com/cd/E24152_01/Platform.10-1/ATGRepositoryGuide/html/s0305multivaluedpropertyqueries01.html

-1
source

All Articles