SlideShare ist ein Scribd-Unternehmen logo
1 von 26
UI Components for Large 
Amounts of Data 
Two examples using GWT 
andreas.hubmer@cenarion.com 
18.10.2014
2
How do we select 
an employee among thousands? 
3
1) Table of Employees 
[Demo] 
4
What do we have? 
• GWT‘s CellTable 
• GWT‘s client-side paging component 
5
What do we want? 
get employees 
• where a field matches some value 
• ordered by some field 
• limited to X results, starting with Y 
6
What do we need? 
• Searching/Filtering 
• Sorting 
• Paging 
fast  within the data base 
7
8
Client side 
Needs to know 
• Table Definition: captions, 
searchable/filterable rows 
• Table Data 
9
Client Table Definition 
new ClientTableDefinition( 
new TextColumnDefinition("firstName", SORTABLE, 
!FILTERABLE, SEARCHABLE, !HIDDEN), 
new TextColumnDefinition("gender", SORTABLE, 
FILTERABLE, !SEARCHABLE, !HIDDEN), 
… 
); 
10
TableResult 
class InitialResult { 
TableDefinition def; 
List<String> captions; 
List<String> searchValues; 
List<List<String>> availableFilters; 
} 
class TableResult { 
InitialResult initialResult; 
List<TableRow> tableRows; 
String sortColumn; SortOrder sortOrder; 
int pageSize; int startIndex; int totalCount; 
} 
11
Server side 
Needs to know 
• Table Definition: captions, filterable 
rows, technical field names 
• Mapping of search/filter/order to 
query 
• Mapping of database results to table 
rows 
12
Server side sequence 
• loadSaveSettings 
• if (firstRequest) 
captions, search/filter values 
• createQuery: search, filter, order 
• executeQuery: with paging 
• mapQueryResults 
• executeCountQuery: no „order“ 
• setPagerData 
13 
Request 
Response
Server Table Definition 
new TableDefinition<Employee>( 
new EmployeeQueryCreator(), 
new TextColumn("firstName", 
e -> e.getFirstName()), 
new FilterColumn("gender", 
e -> e.getGender(), GENDER.values()), 
… 
); 
14
Usability: LIKE 
Query: 
SELECT e FROM Employee e where e.firstName LIKE 
:searchValue 
Case-insensitive collation: 
@Column(columnDefinition= 
"VARCHAR(255) COLLATE "English UCC"") 
private String firstName; 
15
Usability: search = rendering 
Rendered string for supervisor: 
firstName + " " + lastName 
Search string: „and“ 
 where firstName like 'and%' 
or lastName like 'and%' 
Search string: „andreas hu“ 
 where firstName like 'andreas%' 
and lastName like 'hu%' 
16
How do we select an employee 
in a small widget by name? 
17
2) Suggest Box 
[Demo] 
18
What do we have? 
• GWT‘s SuggestBox 
relying on a SuggestOracle: 
query  List<Suggestion> 
19
What do we need? 
• Remote oracle for filtering, sorting, 
paging (in the data base) 
• Timer 
• Highlighting 
20
SuggestOracle 
class SuggestOracle { 
void requestSuggestions(Request request, 
Callback callback); 
} 
class Request { int limit = 20; String query; } 
class Response { 
Collection<Suggestion> suggestions; 
} 
class Suggestion { 
String displayString; String replacement; 
} 
21
3) Performance 
Indices 
Count query too expensive? 
-> „more results“ instead of exact count 
22
23
24
Thanks 
www.cenarion.com
GWT 
• Single Page 
• Only Java code 
– easy client-side unit tests 
– rich clients 
• GWT 2.6 supports Maps 
• Wire transport 
– RPC 
– RequestFactory 
26

Weitere ähnliche Inhalte

Was ist angesagt?

Vaadin 7 FieldGroup & Converter
Vaadin 7 FieldGroup & ConverterVaadin 7 FieldGroup & Converter
Vaadin 7 FieldGroup & ConverterNicolas Fränkel
 
Django ORM - Marcin Markiewicz
Django ORM - Marcin Markiewicz Django ORM - Marcin Markiewicz
Django ORM - Marcin Markiewicz Sunscrapers
 
When to NoSQL and when to know SQL
When to NoSQL and when to know SQLWhen to NoSQL and when to know SQL
When to NoSQL and when to know SQLSimon Elliston Ball
 
Cfml features modern coding into the box 2018
Cfml features modern coding into the box 2018Cfml features modern coding into the box 2018
Cfml features modern coding into the box 2018Ortus Solutions, Corp
 
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2Tay Atcharawan
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5bqconf
 
New Framework - ORM
New Framework - ORMNew Framework - ORM
New Framework - ORMOdoo
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and FunctionsJussi Pohjolainen
 

Was ist angesagt? (10)

Vaadin 7 FieldGroup & Converter
Vaadin 7 FieldGroup & ConverterVaadin 7 FieldGroup & Converter
Vaadin 7 FieldGroup & Converter
 
Django ORM - Marcin Markiewicz
Django ORM - Marcin Markiewicz Django ORM - Marcin Markiewicz
Django ORM - Marcin Markiewicz
 
When to NoSQL and when to know SQL
When to NoSQL and when to know SQLWhen to NoSQL and when to know SQL
When to NoSQL and when to know SQL
 
Cfml features modern coding into the box 2018
Cfml features modern coding into the box 2018Cfml features modern coding into the box 2018
Cfml features modern coding into the box 2018
 
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2
การเขียนคำสั่งควบคุมขั้นพื้นฐาน 2
 
ClevelandDayofDotNet_JoshClark
ClevelandDayofDotNet_JoshClarkClevelandDayofDotNet_JoshClark
ClevelandDayofDotNet_JoshClark
 
FetchQ - the origins
FetchQ - the originsFetchQ - the origins
FetchQ - the origins
 
大量地区化解决方案V5
大量地区化解决方案V5大量地区化解决方案V5
大量地区化解决方案V5
 
New Framework - ORM
New Framework - ORMNew Framework - ORM
New Framework - ORM
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
 

Ähnlich wie Filter, Sort and Page Large Datasets with GWT CellTable and SuggestBox

Complex Queries using MYSQL00123211.pptx
Complex Queries using MYSQL00123211.pptxComplex Queries using MYSQL00123211.pptx
Complex Queries using MYSQL00123211.pptxmetriohanzel
 
Data Manipulation(DML) and Transaction Control (TCL)
Data Manipulation(DML) and Transaction Control (TCL)  Data Manipulation(DML) and Transaction Control (TCL)
Data Manipulation(DML) and Transaction Control (TCL) MuhammadWaheed44
 
Class 8 - Database Programming
Class 8 - Database ProgrammingClass 8 - Database Programming
Class 8 - Database ProgrammingAhmed Swilam
 
Sql Patterns
Sql PatternsSql Patterns
Sql Patternsphanleson
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Finalmukesh24pandey
 
Hibernate Session 4
Hibernate Session 4Hibernate Session 4
Hibernate Session 4b_kathir
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineeringJulian Hyde
 
Data Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdfData Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdfhowto4ucontact
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONKeshav Murthy
 
Csharp4 arrays and_tuples
Csharp4 arrays and_tuplesCsharp4 arrays and_tuples
Csharp4 arrays and_tuplesAbed Bukhari
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimizationVivek Singh
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateKiev ALT.NET
 
How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsChad Petrovay
 

Ähnlich wie Filter, Sort and Page Large Datasets with GWT CellTable and SuggestBox (20)

Complex Queries using MYSQL00123211.pptx
Complex Queries using MYSQL00123211.pptxComplex Queries using MYSQL00123211.pptx
Complex Queries using MYSQL00123211.pptx
 
Chapter08
Chapter08Chapter08
Chapter08
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
Hibernate III
Hibernate IIIHibernate III
Hibernate III
 
Data Manipulation(DML) and Transaction Control (TCL)
Data Manipulation(DML) and Transaction Control (TCL)  Data Manipulation(DML) and Transaction Control (TCL)
Data Manipulation(DML) and Transaction Control (TCL)
 
Class 8 - Database Programming
Class 8 - Database ProgrammingClass 8 - Database Programming
Class 8 - Database Programming
 
Sql Patterns
Sql PatternsSql Patterns
Sql Patterns
 
For Beginners - C#
For Beginners - C#For Beginners - C#
For Beginners - C#
 
Sql wksht-2
Sql wksht-2Sql wksht-2
Sql wksht-2
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
Hibernate Session 4
Hibernate Session 4Hibernate Session 4
Hibernate Session 4
 
Tactical data engineering
Tactical data engineeringTactical data engineering
Tactical data engineering
 
Data Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdfData Base Management System Lecture 10.pdf
Data Base Management System Lecture 10.pdf
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSON
 
DBMS LAB M.docx
DBMS LAB M.docxDBMS LAB M.docx
DBMS LAB M.docx
 
Csharp4 arrays and_tuples
Csharp4 arrays and_tuplesCsharp4 arrays and_tuples
Csharp4 arrays and_tuples
 
Sql query tuning or query optimization
Sql query tuning or query optimizationSql query tuning or query optimization
Sql query tuning or query optimization
 
Clauses
ClausesClauses
Clauses
 
Micro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicateMicro-ORM Introduction - Don't overcomplicate
Micro-ORM Introduction - Don't overcomplicate
 
How Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills setsHow Clean is your database? Data scrubbing for all skills sets
How Clean is your database? Data scrubbing for all skills sets
 

Mehr von Cenarion Information Systems GmbH (6)

MVP mit dem Google Web Toolkit
MVP mit dem Google Web ToolkitMVP mit dem Google Web Toolkit
MVP mit dem Google Web Toolkit
 
GWT: Eintauchen in MVP und Internationalisierung
GWT: Eintauchen in MVP und InternationalisierungGWT: Eintauchen in MVP und Internationalisierung
GWT: Eintauchen in MVP und Internationalisierung
 
Eintauchen in MVP mit GWT
Eintauchen in MVP mit GWT Eintauchen in MVP mit GWT
Eintauchen in MVP mit GWT
 
Datenbankoptimierung
DatenbankoptimierungDatenbankoptimierung
Datenbankoptimierung
 
Query Result Caching
Query Result CachingQuery Result Caching
Query Result Caching
 
GWT – Google Web Toolkit in der Praxis
GWT – Google Web Toolkit in der PraxisGWT – Google Web Toolkit in der Praxis
GWT – Google Web Toolkit in der Praxis
 

Kürzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

Filter, Sort and Page Large Datasets with GWT CellTable and SuggestBox

  • 1. UI Components for Large Amounts of Data Two examples using GWT andreas.hubmer@cenarion.com 18.10.2014
  • 2. 2
  • 3. How do we select an employee among thousands? 3
  • 4. 1) Table of Employees [Demo] 4
  • 5. What do we have? • GWT‘s CellTable • GWT‘s client-side paging component 5
  • 6. What do we want? get employees • where a field matches some value • ordered by some field • limited to X results, starting with Y 6
  • 7. What do we need? • Searching/Filtering • Sorting • Paging fast  within the data base 7
  • 8. 8
  • 9. Client side Needs to know • Table Definition: captions, searchable/filterable rows • Table Data 9
  • 10. Client Table Definition new ClientTableDefinition( new TextColumnDefinition("firstName", SORTABLE, !FILTERABLE, SEARCHABLE, !HIDDEN), new TextColumnDefinition("gender", SORTABLE, FILTERABLE, !SEARCHABLE, !HIDDEN), … ); 10
  • 11. TableResult class InitialResult { TableDefinition def; List<String> captions; List<String> searchValues; List<List<String>> availableFilters; } class TableResult { InitialResult initialResult; List<TableRow> tableRows; String sortColumn; SortOrder sortOrder; int pageSize; int startIndex; int totalCount; } 11
  • 12. Server side Needs to know • Table Definition: captions, filterable rows, technical field names • Mapping of search/filter/order to query • Mapping of database results to table rows 12
  • 13. Server side sequence • loadSaveSettings • if (firstRequest) captions, search/filter values • createQuery: search, filter, order • executeQuery: with paging • mapQueryResults • executeCountQuery: no „order“ • setPagerData 13 Request Response
  • 14. Server Table Definition new TableDefinition<Employee>( new EmployeeQueryCreator(), new TextColumn("firstName", e -> e.getFirstName()), new FilterColumn("gender", e -> e.getGender(), GENDER.values()), … ); 14
  • 15. Usability: LIKE Query: SELECT e FROM Employee e where e.firstName LIKE :searchValue Case-insensitive collation: @Column(columnDefinition= "VARCHAR(255) COLLATE "English UCC"") private String firstName; 15
  • 16. Usability: search = rendering Rendered string for supervisor: firstName + " " + lastName Search string: „and“  where firstName like 'and%' or lastName like 'and%' Search string: „andreas hu“  where firstName like 'andreas%' and lastName like 'hu%' 16
  • 17. How do we select an employee in a small widget by name? 17
  • 18. 2) Suggest Box [Demo] 18
  • 19. What do we have? • GWT‘s SuggestBox relying on a SuggestOracle: query  List<Suggestion> 19
  • 20. What do we need? • Remote oracle for filtering, sorting, paging (in the data base) • Timer • Highlighting 20
  • 21. SuggestOracle class SuggestOracle { void requestSuggestions(Request request, Callback callback); } class Request { int limit = 20; String query; } class Response { Collection<Suggestion> suggestions; } class Suggestion { String displayString; String replacement; } 21
  • 22. 3) Performance Indices Count query too expensive? -> „more results“ instead of exact count 22
  • 23. 23
  • 24. 24
  • 26. GWT • Single Page • Only Java code – easy client-side unit tests – rich clients • GWT 2.6 supports Maps • Wire transport – RPC – RequestFactory 26