• Danilo Oliveira
    Danilo Oliveira, 2014/07/17 23:48

    If you need retrieve random results from some search you can try to use the random parameter in the SQL statement. For example, in the example below we retrieve 2 docs of a specific class randomly:

    #set($hql0 = ", BaseObject as obj where doc.fullName = obj.name and doc.fullName != 'Filmes.FilmesTemplate' and (obj.className = 'Filmes.FilmesClass') order by rand() desc")
    #set ($listProjetos = $services.query.hql($hql0).setLimit(2).execute())
    $listProjetos

Get Connected