Querydsl Reference Guide

Timo Westkämper

Samppa Saarela

Vesa Marttila

Lassi Immonen

Ruben Dijkstra

John Tims

Robert Bain

4.0.9

This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the Apache License, Version 2.0.


Table of Contents

Preface
1. Introduction
1.1. Background
1.2. Principles
2. Tutorials
2.1. Querying JPA
2.1.1. Maven integration
2.1.2. Ant integration
2.1.3. Using Querydsl JPA in Roo
2.1.4. Generating the model from hbm.xml files
2.1.5. Using query types
2.1.6. Querying
2.1.7. Using joins
2.1.8. General usage
2.1.9. Ordering
2.1.10. Grouping
2.1.11. Delete clauses
2.1.12. Update clauses
2.1.13. Subqueries
2.1.14. Exposing the original query
2.1.15. Using Native SQL in JPA queries
2.2. Querying JDO
2.2.1. Maven integration
2.2.2. Ant integration
2.2.3. Using query types
2.2.4. Querying with JDO
2.2.5. General usage
2.2.6. Ordering
2.2.7. Grouping
2.2.8. Delete clauses
2.2.9. Subqueries
2.2.10. Using Native SQL
2.3. Querying SQL
2.3.1. Maven integration
2.3.2. Code generation via Maven
2.3.3. Code generation via ANT
2.3.4. Creating the query types
2.3.5. Configuration
2.3.6. Querying
2.3.7. General usage
2.3.8. Joins
2.3.9. Ordering
2.3.10. Grouping
2.3.11. Using Subqueries
2.3.12. Selecting literals
2.3.13. Query extension support
2.3.14. Window functions
2.3.15. Common table expressions
2.3.16. Other SQL expressions
2.3.17. Using Data manipulation commands
2.3.17.1. Insert
2.3.17.2. Update
2.3.17.3. Delete
2.3.18. Batch support in DML clauses
2.3.19. Bean class generation
2.3.20. Extracting the SQL query and bindings
2.3.21. Custom types
2.3.22. Listening to queries and clauses
2.3.23. Spring integration
2.4. Querydsl Spatial
2.4.1. Maven integration
2.4.2. Code generation via Maven
2.4.3. Runtime configuration
2.4.4. Querying
2.4.4.1. Filter by Distance
2.4.4.2. Contains
2.4.4.3. Intersection
2.4.4.4. Access to the SPATIAL_REF_SYS table
2.4.5. Inheritance
2.5. Querying Lucene
2.5.1. Maven integration
2.5.2. Creating the query types
2.5.3. Querying
2.5.4. General usage
2.5.5. Ordering
2.5.6. Limit
2.5.7. Offset
2.5.8. Fuzzy searches
2.5.9. Applying Lucene filters to queries
2.6. Querying Hibernate Search
2.6.1. Creating the Querydsl query types
2.6.2. Querying
2.6.3. General usage
2.7. Querying Mongodb
2.7.1. Maven integration
2.7.2. Querying
2.7.3. General usage
2.7.4. Ordering
2.7.5. Limit
2.7.6. Offset
2.7.7. Geospatial queries
2.7.8. Select only relevant fields
2.8. Querying Collections
2.8.1. Usage without generated query types
2.8.2. Usage with generated query types
2.8.3. Maven integration
2.8.4. Ant integration
2.8.5. Hamcrest matchers
2.8.6. Usage with the Eclipse Compiler for Java
2.9. Querying in Scala
2.9.1. DSL expressions for Scala
2.9.2. Querying with SQL
2.9.2.1. Code generation
2.9.3. Querying with other backends
3. General usage
3.1. Creating queries
3.1.1. Complex predicates
3.1.2. Dynamic expressions
3.1.3. Dynamic paths
3.1.4. Case expressions
3.1.5. Casting expressions
3.1.6. Select literals
3.2. Result handling
3.2.1. Returning multiple columns
3.2.2. Bean population
3.2.3. Constructor usage
3.2.4. Result aggregation
3.3. Code generation
3.3.1. Path initialization
3.3.2. Customization
3.3.3. Custom type mappings
3.3.4. Delegate methods
3.3.5. Non-annotated types
3.3.6. Classpath based code generation
3.3.6.1. Usage via Maven
3.3.6.2. Scala support
3.4. Alias usage
4. Troubleshooting
4.1. Insufficient type arguments
4.2. Multithreaded initialization of Querydsl Q-types
4.3. JDK5 usage