QueryDSL in Extension Scripts

QueryDSL is a Java query framework that uses an object-oriented API to build database queries. QueryDSL is now part of the Extension Script framework and allows scripts to read database data using Java code instead of SQL.

See Debugging with the Extension Script Tester.

Availability

All extension scripts types can use QueryDSL to query the following Custom Data tables in production:
  • wb_custom_data
  • wb_custom_data_type
  • wb_custom_lookup_data
  • wb_custom_lookup_data_type

The Extension Script Tester supports QueryDSL and provides access to other WFM tables. These WFM tables are available for testing only and cannot be used in production scripts. The complete list of test-only tables is documented in the Publ Javadoc.

Using QueryDSL

QueryDSL uses auto-generated Java classes called Q classes. Each Q class represents a WFM database table and its columns, making queries easier to write and less likely to contain errors.

For example, you can use QEmployee.employee to represent the employee table and access its fields, such as employee.name and employee.active when building queries. This improves readability and reduces errors caused by misspelled or invalid column names.