Advanced Queries
Service Builder doesn’t limit you to <finder />
elements in service.xml
. If simple finders aren’t sufficient for getting data out of your application, there are three other ways to make the exact queries you need:
-
Domain-Specific Language Queries make the writing of queries and other logic more natural and less error-prone.
-
You can use custom SQL queries with Service Builder to retrieve data from the database.
-
Liferay’s Dynamic Query API wraps Hibernate’s Criteria API. It helps you think in terms of objects and member variables instead of tables and columns. Complex queries can be significantly easier to understand and maintain than the equivalent custom SQL (or HQL) queries.