没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Querydsl - Reference Documentation
Timo Westkämper
Samppa Saarela
Vesa Marttila
Lassi Immonen
Querydsl - Reference Documentation
by Timo Westkämper, Samppa Saarela, Vesa Marttila, and Lassi Immonen
3.2.2
Copyright © 2007-2013 Mysema Ltd.
Legal Notice
Copyright © 2007-2013 by Mysema Ltd. 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.
Querydsl
3.2.2
Querydsl - Reference
Documentation iii
Table of Contents
Preface ........................................................................................................................................... vi
1. Introduction ................................................................................................................................. 1
1.1. Background ...................................................................................................................... 1
1.2. Principles .......................................................................................................................... 1
2. Tutorials ...................................................................................................................................... 2
2.1. Querying JPA ................................................................................................................... 2
Maven integration ............................................................................................................ 2
Ant integration ................................................................................................................ 3
Using Querydsl JPA in Roo ............................................................................................. 4
Generating the model from hbm.xml files ......................................................................... 4
Using query types ............................................................................................................ 4
Querying ......................................................................................................................... 5
Using joins ...................................................................................................................... 6
General usage .................................................................................................................. 7
Ordering .......................................................................................................................... 7
Grouping ......................................................................................................................... 8
Delete clauses .................................................................................................................. 8
Update clauses ................................................................................................................. 8
Subqueries ....................................................................................................................... 9
Exposing the original query ............................................................................................. 9
Using Native SQL in JPA queries .................................................................................... 9
2.2. Querying JDO ................................................................................................................. 11
Maven integration .......................................................................................................... 11
Ant integration ............................................................................................................... 12
Using query types .......................................................................................................... 13
Querying with JDO ........................................................................................................ 14
General usage ................................................................................................................ 15
Ordering ........................................................................................................................ 15
Grouping ....................................................................................................................... 15
Delete clauses ................................................................................................................ 15
Subqueries ..................................................................................................................... 16
Using Native SQL ......................................................................................................... 16
2.3. Querying SQL ................................................................................................................ 18
Maven integration .......................................................................................................... 18
Code generation via Maven ............................................................................................ 18
Code generation via ANT .............................................................................................. 20
Creating the query types ................................................................................................ 20
Querying ....................................................................................................................... 21
General usage ................................................................................................................ 22
Joins .............................................................................................................................. 22
Querydsl
3.2.2
Querydsl - Reference
Documentation iv
Ordering ........................................................................................................................ 23
Grouping ....................................................................................................................... 23
Using Subqueries ........................................................................................................... 23
Query extension support ................................................................................................. 24
Window functions .......................................................................................................... 24
Using Data manipulation commands ............................................................................... 25
Insert ..................................................................................................................... 25
Update ................................................................................................................... 25
Delete .................................................................................................................... 26
Batch support in DML clauses ....................................................................................... 26
Bean class generation ..................................................................................................... 27
Custom types ................................................................................................................. 28
2.4. Querying Lucene ............................................................................................................. 28
Maven integration .......................................................................................................... 28
Creating the query types ................................................................................................ 29
Querying ....................................................................................................................... 29
General usage ................................................................................................................ 30
Ordering ........................................................................................................................ 30
Limit ............................................................................................................................. 31
Offset ............................................................................................................................ 31
Fuzzy searches ............................................................................................................... 31
Applying Lucene filters to queries .................................................................................. 31
2.5. Querying Hibernate Search .............................................................................................. 32
Creating the Querydsl query types .................................................................................. 32
Querying ....................................................................................................................... 32
General usage ................................................................................................................ 32
2.6. Querying Mongodb ......................................................................................................... 32
Maven integration .......................................................................................................... 32
Querying ....................................................................................................................... 33
General usage ................................................................................................................ 34
Ordering ........................................................................................................................ 34
Limit ............................................................................................................................. 34
Offset ............................................................................................................................ 34
Geospatial queries .......................................................................................................... 35
Select only relevant fields .............................................................................................. 35
2.7. Querying Collections ....................................................................................................... 35
Usage without generated query types .............................................................................. 35
Usage with generated query types ................................................................................... 36
Maven integration .......................................................................................................... 36
Ant integration ............................................................................................................... 37
Hamcrest matchers ......................................................................................................... 38
2.8. Querying in Scala ........................................................................................................... 38
Querydsl
3.2.2
Querydsl - Reference
Documentation v
DSL expressions for Scala ............................................................................................. 39
Improved projections ..................................................................................................... 39
Querying with SQL ....................................................................................................... 40
Compact queries .................................................................................................... 41
Code generation ..................................................................................................... 41
Querying with other backends ........................................................................................ 42
3. General usage ............................................................................................................................ 44
3.1. Creating queries .............................................................................................................. 44
Complex predicates ........................................................................................................ 44
Dynamic expressions ..................................................................................................... 44
Dynamic paths ............................................................................................................... 45
Case expressions ............................................................................................................ 46
Casting expressions ........................................................................................................ 46
3.2. Result handling ............................................................................................................... 47
Returning multiple columns ............................................................................................ 47
Bean population ............................................................................................................. 47
Constructor usage .......................................................................................................... 48
Result aggregation ......................................................................................................... 49
3.3. Code generation .............................................................................................................. 49
Path initialization ........................................................................................................... 50
Customization ................................................................................................................ 50
Custom type mappings ................................................................................................... 52
Delegate methods ........................................................................................................... 53
Non-annotated types ...................................................................................................... 54
Classpath based code generation ..................................................................................... 55
Usage via Maven ................................................................................................... 56
Scala support ......................................................................................................... 57
3.4. Alias usage ..................................................................................................................... 58
4. Troubleshooting ......................................................................................................................... 60
4.1. Insufficient type arguments .............................................................................................. 60
4.2. Multithreaded initialization of Querydsl Q-types ............................................................... 60
4.3. JDK5 usage .................................................................................................................... 61
剩余66页未读,继续阅读
资源评论
lxllzwj5201314
- 粉丝: 58
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功