WaveMaker Visual AJAX Studio 4'0 Training - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

WaveMaker Visual AJAX Studio 4'0 Training

Description:

When you need to do more then insert, update and delete in a ... Example: Atelier graphique, Mini Wheels Co. Query Example 2. Comparing against 1 list of values ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 12
Provided by: eliza111
Category:

less

Transcript and Presenter's Notes

Title: WaveMaker Visual AJAX Studio 4'0 Training


1
WaveMaker Visual AJAX Studio 4.0 Training
  • Custom Queries

2
Creating Custom Queries
  • When you need to do more complex searches then
    supported by views
  • When you need to do more then insert, update and
    delete in a LiveForm
  • When you want to use more advanced SQL parameters
  • Example Get distinct values from a column

3
How to Create a Custom Query
  • From the Go To Menu select Queries or click the
    Queries Icon
  • Query is created using HQL
  • Very similar to SQL
  • Good online tutorials for reference
  • http//www.roseindia.net/hibernate/index.shtml

4
Creating a Query
  • Name and Comment your Query
  • Write your Query
  • Identify any input parameters
  • A sample Query is provide

5
Testing Queries
  • Ability to test queries at design time
  • Enter input values in as Test Parameters Values

6
Query Example1
  • Comparing against 1 or more values
  • Example Give me the countries for the following
    2 customers
  • select customerName, country from Customers _a
    where customerName in (s1, s2)
  • select customerName, country from Customers _a
    where customerNames1 or customerName s2
  • Create 2 input parameters of type string
  • To pass multiple values into the test parameters
  • Pass comma separated values, no quotes
  • Example Atelier graphique, Mini Wheels Co.

7
Query Example 2
  • Comparing against 1 list of values
  • Example Give me all countries for the following
    customers (1 more in a list)
  • select customerName, country from Customers _a
    where customerName in (customerList)
  • Create 1 input parameters of type string
  • Select the list checkbox
  • To pass a list of variables of unknown length
    into the TestBind parameters
  • Use Brackets and seperate values with a comma, no
    quotes
  • Example Atelier graphique, Mini Wheels Co.

8
Query Example 3
  • Getting Distinct Values
  • Example Give me all distinct countries from the
    customer table
  • select distinct country, count(country) from
    Customers group by country
  • Must return more then 1 column even though it is
    not needed

9
Custom Query Tips
  • Table names and column names are case sensitive
  • Check the LiveTable datamodel for correct syntax
  • If using aliases use all lower case
  • from customers _cust not from customer _Cust
  • Notice the returns a single result checkbox
    under query definition
  • Multiple results will return when testing but at
    runtime errors may be thrown
  • You must return more then 1 column.

10
  • Questions?

11
Exercise 16
  • Create a custom query to return distinct values
  • Test the query
Write a Comment
User Comments (0)
About PowerShow.com