O'Reilly logo

Liferay Portal Systems Development by Jonas X. Yuan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom query

A custom query allows creating dynamic criteria, like dynamic query API. In many situations, this avoids the need to create a custom query completely. However, in some cases, a custom query, called custom-sql, could be useful. For instance, there is a complex JOIN query and it is hard to do in the dynamic query API. In this case, custom query would be very helpful.

Let's consider a real example. A query says "find me all the articles with a specific companyId and groupId, subscribed to by a specific user, ordered by createDate". Of course, you could use the dynamic query API. Here, we are using this request as an example to show how to build a custom query in the Plugins SDK.

In general, you should be able to build a custom query in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required