WaveMaker Docs

WaveMaker Docs

  • Get started
  • Widgets
  • Mobile
  • How-to
  • Enterprise
  • Releases
  • Blog
  • Sign-in

›Java services

How-to-documents

  • How-to Wiki
  • WaveMaker Best Practices

App solution

  • Creating a Registration Page
  • Support for Password Encryption
  • Error Handling in WaveMaker App
  • Leaving Page with Unsaved Changes
  • Micro frontend using iframes
  • Enabling PWA

UI design

  • Passing Parameters to Pages
  • Passing Parameters to Partial Page
  • Accessing Script
  • Use Static Variable to pass data between pages
  • Customise Login Page
  • Incorporating Additional Icons
  • Change Icon Color on Condition
  • Change Icon for the Global Spinner
  • Changing Default Favicon
  • Changing App Logo
  • Changing Page Title
  • Customise App Style
  • How to use Conditional Class Property
  • How to use Conditional Style Property
  • Customize an Existing Theme
  • Adjust Left Navigation Width
  • Customizing Theme
  • Enable SPA
  • Choose Widget Template and Layout
  • Widget Template and Icons
  • Custom Template for Widgets
  • Apply Custom Data Formatter

Nav & Dropdown

  • Dynamic Menu based on User Role
  • Restricting Menu Items based on the User Role
  • Localization for Dropdown Menu

Localization

  • Localization in WaveMaker Apps
  • Setting Language and Date Format
  • Localization Using Select Locale
  • Localization of Error Messages

Security

  • SAML Integration - OneLogin
  • SAML Integration - ADFS
  • OpenID Integration - Azure AD
  • Custom Security using Google OAuth Prefab
  • Multiple Security Provider Implementation
  • Customizing Post Authentication Handlers
  • Configuring Content-Security-Policy
  • Configuring MTLS

Databases

  • Queries with Dynamic Where Clause
  • Connect To Azure SQL Server
  • Recommended JDBC Driver Versions for Databases
  • How to fetch more than the default number(100) of records from database?
  • How To: One-to-Many Relationship
  • Working with Temporals
  • Connect To AWS Redshift Database
  • Connect To SAP Hana Cloud Database
  • Transactional History of Entity
  • Row-Level Security using DB Event Listeners
  • Validations using CRUD Listeners
  • Custom Logic DB Event Listeners
  • Connect to MySQL database using SSL
  • How to Switch MariaDB to MySQL Connector

Web services

  • Using App Environment Properties
  • Consuming an Existing WaveMaker API
  • Using POST method to send data to a REST API
  • Request-Response Processing for REST Services
  • How to Intercept Request and Response of all API Calls in One Place
  • WebSocket Usage - Chatroom App
  • UI for API Server-side Pagination
  • Working with API with different pagination formats

Java services

  • Sending Email using WaveMaker Connector
  • Implementing Forgot Password feature using Java Service
  • Accessing REST APIs from Java Service
  • Scheduling a Java Service
  • Integrating JUnit Tests for WaveMaker Application
  • ORM Artifacts
  • Pre-Post Processing for Database Service APIs
  • Accessing Logged-in User Details using Java Service
  • Design a workflow in Camunda BPM and integrate into a WaveMaker app
  • Integrate Azure File Storage
  • Insert Data from Excel into Database
  • Integrate Amazon S3 into WaveMaker App
  • Integrate Twilio Connector
  • Integrate OTP (One-Time Passcode) Verification with WaveMaker App

Variables

  • Using Filter Conditions on Variable
  • Using Live Variable APIs
  • Using Notification Actions
  • Using Navigation Action
  • Using Variables for Queries and Procedure
  • Using Service Variable in a Form
  • Using Filter Criteria for a Data and Live Widgets
  • Using Filter Criteria for a Database CRUD Variable

JavaScript

  • Using JavaScript in Binding
  • Using JavaScript from External URL
  • Using JavaScript to loop a command
  • Using function for evaluating conditions

Developer options

  • Synchronizing WaveMaker Apps with IDEs
  • Synchronizing Java Services Controller
  • Integrating Amazon Cognito for User Authentication
  • Integrating Sample Jasper Report in WaveMaker Application
  • How to generate PDF File using Jasper Reports
  • Upgrading an App from WaveMaker 9.x to WaveMaker 10.0
  • App Migration from WaveMaker 9x to 10x
  • Setup Fusion Reactor for Debugging Issues

Deployment

  • SSL Termination in LoadBalancer

Mobile App Solutions

  • Notify users about new update

Mobile gesture

  • Setting Swipe Gestures on a List Widget
  • Working with Pull to Refresh

Mobile widgets

  • Using Search Widget within the Navbar

Mobile UI design

  • Setting Splashscreen Images and App Icons
  • Using Cordova Plugins
  • Designing Tablet Views in Mobile Project
  • Sliding left navigation for Mobile App
  • Mobile App using Bar code
  • Custom Date Picker in Mobile

Cards

  • Capturing Card Items

DataTable

  • Customising Data Table Row Action
  • How to Configure Row Expansion in a Data Table
  • Using Widgets to represent Data Table Columns
  • View Master-Detail Data Records using Data Table
  • Add Master-Detail records using Data Table
  • Export Data from Data Table
  • Export Data from Data Table - 2
  • Setting Blob Filename
  • Dynamic Data Tables
  • Customize Dynamic Datatable
  • Data Table Column bound to Query
  • Combining Columns in Data Table
  • Custom Styling Data Table Columns & Rows
  • Formatting Data Table Columns
  • Concurrency and Record Locking in WaveMaker
  • Edit DataTable records bound to Query API

List

  • Creating an Employee List grouped by City
  • Creating an Employee List grouped by Birth Month and City
  • OnRender Event
  • Including a Data Table within a List
  • Building an Editable List
  • Building Cascading Lists
  • Accessing List Items
  • Localization of Data Table Column Headings

Forms

  • Using Live Form
  • How Tos: Form
  • Building Tabbed Live Form
  • How Tos: Live Form
  • Linking Live Form with another Widget for Input
  • Handling Related Fields in a Live Form
  • How to Get Validation Messages from a Form
  • Adding Master-Detail records in the same transaction
  • Submit Parent and Child Records in a Single Transaction
  • Submit Parent and Child Records in a Single Transaction using Form and Data Table
  • Using Cascading Select & Autocomplete for Live Form Fields
  • Using Cascading Select within Live Form
  • Using cascading Filter to populate Live Form
  • Using Wizard for Master-Detail Live Form
  • Copy to Clipboard
  • Create a form with multiple wizard steps
  • Smart Forms: Conditional Flows for form Widget

Calendar

  • How Tos: Calendar
  • Calendar Usage - Create an Event
  • Calender Usage - Google Calendar Integration

CheckboxSet

  • CheckboxSet to Filter List data

FileUpload

  • FileUpload - Basic Usage
  • File Upload Widget Operations
  • Upload File & Save in Database
  • File Upload & Blob Data
  • File Upload - Custom Directory
  • Accessing File Upload from Java Code
  • Upload Files from Live Form & Form

Radioset

  • Radioset to Filter a List

Rating

  • Building Rating Widget using Static Data
  • Building Rating Widget using Static Variable
  • Build Rating Widget using Model Variable
  • Building an Interactive Rating Widget

Select

  • Configuring Select Widget from a Static List of Values
  • Configuring Select Widget from a Static Variable
  • Configuring Select Widget from a Variable
  • Configuring Select Widget using Display and Data Fields
  • Configuring Select Widget from Database Fields
  • Configuring Cascading Select
  • Selection Widgets - Use Case

Progress Circle

  • Using Progress Circle Widget

Charts

  • Working with Charts
  • Display User Selection in another Widget
  • Handling Dynamic Data
  • Custom Data

Richtext Editor

  • Adding Custom Fonts to Richtext Editor

Live filter

  • Applying Live Filter to a Data Table or a Chart
  • Building a Multiple Selection Live Filter
  • Building a Range Live Filter

Container

  • Setting partial page content for Accordion within a List
  • Setting partial page content for Panel within a List using JavaScript
  • How Tos: Wizard
  • Dynamic Tabs and Accordions

Tree

  • Tree using Static Variable
  • Tree using Java Service
  • Tree using Dynamic Tree

Prefabs

  • Creating Partials in a Prefab
  • Create Prefab using Third Party UI Widgets
  • Create a Simple Prefab
  • Create Prefab Using D3 & NVD3 Charts
  • Create Prefab Using D3 Library DataMaps
  • Create Prefab using JQuery Plugin
  • Create Prefab using Angular Module
  • Create Prefab using Angular, React Components
  • Azure OAuth Prefab Integration

Team Poral Configure Vcs

  • Configure Azure Repos In CodeRepository
Edit

ORM Artifacts


Integration of WaveMaker app with database generates few files, services, and APIs. These are used internally by WaveMaker to achieve the seamless integration. This information is for advanced developers who want more control or need more information for academic interests.

Layered Architecture

When a database is integrated into a WaveMaker app, it generates the source code for CRUD operations for each entity within the database. In addition to the CRUD APIs, the filter, count, and export APIs are also generated. Associated APIs in the case of related tables are also generated.

The source code is generated with the ORM, Service Layer & REST APIs with each layer having a specific responsibility:

  • Layer 1: REST Controller is responsible for transporting the data between client and server, authorization of APIs & marshaling and unmarshaling of the model to JSON etc.
  • Layer 2: Service Layer is responsible for validating the inputs and transaction management
  • Layer 3: DAO Layer is responsible for interacting with the underlying database

The following diagram depicts the Layered Architecture mentioned above:

Generated Files

The folder structure for the generated code is as follows:

  1. Controllers generated for entities (one for each entity), queries and procedures:

  1. Data Access Objects (DAO) for each of the entities:

  1. Service Interfaces and Service Implementations for entities, queries, and procedures

  1. POJOs for each entity

Each of the layers performs its function and delegates the call to the next layer in the chain. For example, after the unmarshaling of the JSON data to the model, and authorization checks, the REST layer delegates the call to the service layer, and more.

Design time Configuration Files

It contains files required for designing database.

  • db-connection-settings.json: it contains connection properties.
  • servicename_API.json: Generated API specification (swagger) of given service.
  • servicename_procedure.json: contains information regarding procedures for that service.
  • servicename_query.json: contains information regarding query for that service.
  • servicename_published_datamodel.json: contains database schema information. It plays a major role while updating DB changes. Whenever you do manual changes in the database you have to re-import to update this file.
  • servicename_draft_datamodel.json: Contains user modifications. It’ll delete when we do update/re-import database.
  • servicedef.xml: contains types information for this service.

Generated APIs for Database Services

Import or creation of database within a WaveMaker app results in the auto-generation of ORM artifacts from the Database Schema and as such each Schema needs to have a Primary key either single or composite.

In case your external database schema comes without a primary key, you need to assign a column(s) as virtual primary key else all the columns are treated as part of a composite primary key. For each entity imported, a REST API is generated for each of the CRUD operations, Filter and Count functionalities. These REST APIs are exposed via the API Designer and can be tested and reconfigured as per the application needs.

As an example, we are using the following Employee-Department Database Schema (Sample hrdb that can be imported into Studio) with a unique constraint for Dept_code on the department table:

Request Mapping:

[PROJECT_ID]/[PROJECT_NAME]/services/[SERVICE_NAME]/[ENTITY_NAME]/

Example:

CRUD APIs

Create

Inserts a record into the table.

  • URL: /
  • Request Type: POST
  • Path Variables: None
  • Request Parameter: None
  • Request Body: object in JSON format
  • Method Name Example: createEmployee

Read (primary key based)

Retrieves the data associated with given ID value.

  • URL: /{id}
  • Request Type: GET
  • Path Variables: primary key column value
  • Request Parameter: None
  • Request Body: none
  • Method Name Example: getEmployee

Read (unique key based)

Retrieves the data associated with given unique key value.

  • URL: /[UNIQUE_KEY]/{unique_key_value}
  • Request Type: GET
  • Path Variables: unique key column value
  • Request Parameter: None
  • Request Body: none
  • Method Name Example: getByDeptCode (unique key for department entity)

Read (foreign key based)

Retrieves the data associated with given ID value from the related table.

  • URL: /{id..+}/[relation_field]
  • Request Type: GET
  • Path Variables: primary key column value
  • Request Parameter:
    • Page,
    • Size,
    • Sort
  • Request Body: none
  • Method Name: findAssociatedEmployees (employee foreign key for department entity)

READ (foreign key based - self-referential)

Retrieves the data associated with given ID value

  • URL: /{id..+}/[relation_field]
  • Request Type: GET
  • Path Variables: primary key column value
  • Request Parameter:
    • Page,
    • Size,
    • Sort
  • Request Body: none
  • Method Name: findAssociatedEmployeesForManagerId (foreign key)

Update

Updates entity record associated with the given id value

  • URL: /{id}
  • Request Type: PUT
  • Request Type: primary key column value
  • Request Parameter: None
  • Request Body: object in JSON format
  • Method Name Example: editEmployee

Delete

Deletes entity record associated with the given id.

  • URL: /{id}
  • Request Type: DELETE
  • Request Type: primary key column value
  • Request Parameter: None
  • Request Body: None
  • Method Name Example: deleteEmployee

Query APIs

note

Though the following APIs are available in POST and GET type, GET APIs might fail if the request URL is longer than 2048. It is advisable to use POST request type.

FILTER

Returns the list of entity instances matching the filter criteria (all values if query is not given).

  • URL: filter
  • Request Type: POST/GET
  • Request Type: None
  • Request Parameter:
    • custom query (optional, see here for query syntax),
    • Page,
    • Size,
    • Sort
  • Request Body: None Method Name: findEmployees

COUNT

Returns the count of filtered entity instances (total count if query not given)

  • URL: /count
  • Request Type: POST/GET
  • Request Type: None
  • Request Parameter: custom query (optional, see here for query syntax)
  • Request Body: None
  • Method Name: countEmployees

EXPORT

Returns the downloadable file url for the filtered data

  • URL: /export
  • Request Type: POST
  • Request Parameter: pageable - pagination and sorting options, see here for more,
    • Size,
    • Sort
  • Request Body: ExportOptions (Body)
    • custom query (optional, see here for query syntax),
    • fields list (optional):
    [{ “header”:”<column_display_name>”, “field”:”<entity_field_name>”, “expression”:”<custom_expression>” (eg: (${field_name} (or) <any string>)) }]
    
    • exportType - data format for export can be EXCEL or CSV
    • fileName: exported file name
  • Method Name Example: exportEmployees

Custom Query Syntax

The APIs generated by WaveMaker for all the imported tables will have methods that take a query as input. Here we will look at the usage of such query in APIs.

APIs that use HQL Queries: The Filter, Count and Export API in every Table Controller will use the HQL query, which is an optional parameter, for retrieving the data. These APIs can be found in respective tables’ controller class file.

Filter API

This API returns the list of Entity objects that matches the given filter conditions in the query. If query param is empty, API returns all the Entity objects.

Count API

Returns the count of Entities that matches the given filter conditions in the query. For an empty query, it returns the count of all Entity objects.

Export API

Returns a downloadable file with the list of Entities that matches the given filter conditions in the query. For an empty query, we get all the Entity objects.

Query Composition

The HQL query mainly consists of four types of parameters.

  • Field Name
  • Value Expression
  • Value
  • Logical Expression
note

Aggregate functions (avg(), sum(), min(), max()) in HQL query are currently not supported with these APIs.

FieldName parameter

  • The fieldName refers to the name of the field associated with the column in the respective table. The field name is derived from the column name in the table and usually camelCased.

  • The name of the field for a given column can be seen from DB Designer or the respectively generated model class. Field Name of a column can be found in DB designer on the selection of respective column in the properties panel.

  • Relational field names - In order to filter values with respect to an entity in relation, fieldname must be given as entityfield.fieldname. This is applicable only for ManyToOne and OneToOne Relations. Eg: department.name = ‘Engineering’, the name is the fieldname of Department.java

Value Expression parameter

Supported value expression types are listed in below table

OperationExpressionSupported Value TypesResultExamples
equals=Number or StringValues that equals to given value- empId=1
- firstname=’Eric’
not equals!=
(or)
< >
Number or StringValues that are not equal to given value- zip!=02127
- jobTitle< >‘Engineer’
betweenbetweenDate or NumberValues between given range
- birthdate between '1973-10-21' and '1986-06-18' (using date format - YYYY-MM-DD)
- zip between 14231 and 15922
less than<NumberValues less than given value- empId<6
greater than>NumberValues greater than given value- deptId>10
less than or equal to<=NumberValues less or equal to given value- empId<=4
greater than or equal to>=NumberValues greater than or equal to given value- zip>=11
pattern matchinglikeStringValues matching the given pattern- street like ‘4%Houston%’
starts withlikeStringValues starting with the given string- firstname like ‘E%’
ends withlikeStringValues ending with the given string- lastname like ‘%e’
containinglikeStringValues containing the given string- lastname like ‘%e%’
ininNumber or Date or StringValues in the given set- zip in (‘14231’, ‘02127’, ‘11212’)
- birthdate in ('1973-10-21' ,'1986-06-18')
- firstname in ( 'Sally' , 'William' , ‘Amanda’ )
nullis nullStringValues satisfying given condition- role is null
not nullis not nullStringValues satisfying given condition- date is not null
empty=StringValues satisfying given condition- lastname = ‘’
not empty!= (or) <>StringValues satisfying given condition- lastname <> ‘’
- lastname != ‘’

Value parameter

The “Value” parameter is the comparison value for the given field name. The value should be single quoted for non-numeric types. The format for the value of type date is ‘YYYY-MM-DD’.

Logical Expressions

  • A logical expression in HQL does one of the following:
    • joins two or more conditions to form a complex query
    • alters the logic of the conditions
  • Supported logical expressions with examples are listed below
  • Order of execution of conditions can be controlled using parenthesis. Eg: (empId=4 AND zip=02127 ) OR (city like 'New York%' OR birthdate between '1991-01-01' and '1999-12-31' )
Logical ExpressionResultsExamples
AND/andResult set satisfying both conditionsempId>5 AND firstname like ‘A%’
OR/orResult set satisfying either of the conditionsempId=5 OR deptId=1
NOT/notResult set satisfying negation of the conditionsNOT ( firstname like ‘A%’ AND empId=4)

For further reference to HQL query http://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html/ch16.html

Last updated on 11/27/2019 by Swetha Kundaram
← Integrating JUnit Tests for WaveMaker ApplicationPre-Post Processing for Database Service APIs →
  • Layered Architecture
  • Generated Files
    • Design time Configuration Files
  • Generated APIs for Database Services
  • CRUD APIs
    • Create
    • Read (primary key based)
    • Read (unique key based)
    • Read (foreign key based)
    • READ (foreign key based - self-referential)
    • Update
    • Delete
  • Query APIs
    • FILTER
    • COUNT
    • EXPORT
  • Custom Query Syntax
    • Query Composition
    • FieldName parameter
    • Value Expression parameter
    • Value parameter
    • Logical Expressions
WaveMaker
  • PRICING
  • PARTNERS
  • CUSTOMERS
  • ABOUT US
  • CONTACT US
Terms of Use | Copyright © 2013-2023 WaveMaker, Inc. All rights reserved.