Issue
- Not all results in the database are necessary for my purposes. I want to know if it's possible to sort the results by only showing the top results and order it by a date field.
- Can this be done without having to involve a custom DynamicQuery?
Environment
- DXP 7.0+
Resolution
- This is possible by enabling a workaround.
- Specify two finder columns when declaring a new folder. Liferay does this as well.
-
As mentioned in the DTD Service Builder in the Github Knowledge Base, the
<order>
element sets the default ordering. By setting it to the column that you want to use as the date order, you won't need to specify a customOrderByComparator
. It would be best practice for code readability to specify one anyway.
Contenido exclusivo para suscriptores.
Una Suscripción Enterprise de Liferay proporciona acceso a más de 1.500 artículos que incluyen las mejores practicas, diagnóstico de problemas y otras soluciones útiles. Inicia sesión para tener un acceso completo.
Inicia sesión