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 ...