Book Image

Liferay Portal Systems Development

Book Image

Liferay Portal Systems Development

Overview of this book

Liferay portal is one of the most mature portal frameworks in the market, offering many key business benefits that involve personalization, customization, content management systems, web content management, collaboration, social networking and workflow. If you are a Java developer who wants to build custom web sites and WAP sites using Liferay portal, this book is all you need. Liferay Portal Systems Development shows Java developers how to use Liferay kernel 6.1 and above as a framework to develop custom web and WAP systems which will help you to maximize your productivity gains. Get ready for a rich, friendly, intuitive, and collaborative end-user experience! The clear, practical examples in the sample application that runs throughout this book will enable professional Java developers to build custom web sites, portals, and mobile applications using Liferay portal as a framework. You will learn how to make all of your organization's data and web content easily accessible by customizing Liferay into a single point of access. The book will also show you how to improve your inter-company communication by enhancing your web and WAP sites to easily share content with colleagues.
Table of Contents (17 chapters)
Liferay Portal Systems Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

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 projection);

As shown in the preceding code, you can add a criterion in your custom dynamic queries. You can also add order, set limits, and set projection in your custom queries. In addition, the method setProjection implements the SELECT statement...