DataValve Reference Guide

1.0.0.final


Table of Contents

Preface
1. The Itch
2. The Solution
3. Benefits of DataValve
3.1. Interchangable query mechanisms
3.2. Easy querying
3.3. Flexible and secure ordering abstraction
3.4. Convert anything into a dataset
1. Introduction
1.1. Overview
1.2. Architecture
1.3. Examples
2. Database driven providers
2.1. Simple fetches
2.2. Restricting results
2.3. Parameter resolvers
2.3.1. Using your own parameter prefix
2.4. Order in the house
2.5. Polymorphism
2.6. Mapping SQL to objects
3. Implementing and testing a data provider
3.1. Our first DataProvider
3.2. Testing our DataProvider
3.3. Using our DataProvider
3.3.1. I want it all
3.3.2. Iteratively speaking
3.3.3. Paging datasets
3.3.4. Manually fetching data
4. The DataValve architecture
4.1. List of Module
4.2. Data provider types
4.2.1. ParameterizedDataProvider
4.2.2. StatementDataProvider
4.2.3. QueryDataProvider
4.2.4. AbstractQlDataProvider
4.2.5. AbstractQueryDataProvider
4.3. ObjectDataset Types
4.4. ObjectDataset usage
4.5. Choosing a dataset type
4.6. Extending DataProvider implementations
4.6.1. void doPreFetch()
4.6.2. Integer doFetchResultCount()
4.6.3. List<T> doFetchResultCount()
4.6.4. Integer doPostFetchResultCount(Integer resultCount)
4.6.5. List<T> doPostFetchResultCount(List<T> results,Paginator paginator)
4.6.6. Extending data providers
4.7. Extending datasets for custom providers
5. Non-database providers
5.1. In-memory based datastores
5.2. InMemoryAdapterProvider
5.3. IntegerDataProvider revisited
5.4. File Based Data Providers
5.4.1. TextFileProvider
6. Odds and Ends
6.1. IndexedDataProviderCache
6.2. Don't call record count
6.3. Seam Usage
6.4. DataValve and JSF
6.5. Executing code before a fetch

List of Figures

1. Projects without using DataValve
2. Projects using DataValve
1.1. Architecture overview
3.1. Execution results
3.2. Demo application results
3.3. Output from returning all results
3.4. Output from iterating over a paginated dataset

List of Tables

4.1. List of Modules

List of Examples

1. Coding search queries the hard way.
2. Coding search queries the easy way.
1.1. The DataProvider interface
1.2. Fetching data from a provider
1.3. Limiting the data fetched from a data provider
1.4. Using an ObjectDataset
2.1. Fetching data from a database using JPA
2.2. Restricting the data fetched
2.3. Restricting results with constant parameters
2.4. Restricting with variable parameters
2.5. Alternate value parameters
2.6. Parameter Resolving with Reflection
2.7. Built-in parameter resolution
2.8. Using the Seam data provider
2.9. Using our own parameter parser.
2.10. Ordering on the data
2.11. Implementing the SQL to object mapping
2.12. SQL to object mapping using an external mapper.
3.1. IntegerDataProvider.java
3.2. IntegerDataProvider.java
3.3. IntegerDataProvider.java
3.4. Revised fetchResults method in IntegerDataProvider.java
3.5. Additional tests in IntegerDataProviderTest.java to validate the results returned.
3.6. Changing our demo application to use an ObjectDataset
3.7. Changing our demo application to use an ObjectDataset
3.8. Returning all results
3.9. Iterating through all results
3.10. Attempting manual iteration
3.11. Manually creating provider and pagination instances and fetching results
3.12. Multiple views of the same data
4.1. Poorly typed provider and dataset useage
4.2. Strongly typed data provider and dataset usage
4.3. Type safety with the QueryDataProvider
4.4. Examples of polymorphic provider references
4.5. Writing datasets for custom providers
4.6. Using your new data provider dataset
4.7. Using polymorphism to avoid type lock-in
5.1. In-memory person data provider.
5.2. Sorted in-memory person data provider.
5.3. Testing the InMemoryPersonProvider
5.4. Multiple views using an in-memory adapter.
5.5. In-memory implementation of our Integer provider.
5.6. Testing our in-memory Integer data provider.
5.7. Sorting the Integer data provider.
6.1. Setting up the query prior to fetching.