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

Dynamic query API

The dynamic query API provides an elegant way to define complex queries without a complex setup, or a stiff and abstract learning curve. This API allows us to leverage the existing mapping definitions through access to the Hibernate session. This section is going to show the dynamic query against one table in a plugin, to join tables inside a plugin, to join tables among the plugins, and to join tables among the plugins and the portal core.

The interface of the API is specified in the com.liferay.portal.kernel.dao.orm.DynamicQuery class under the folder /portal-service/src. The following is the interface:

public DynamicQuery add(Criterion criterion); // see details in DynamicQuery.java public DynamicQuery setProjection(Projection ...

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