没有合适的资源?快使用搜索试试~ 我知道了~
mongo querydsl 官网文档
试读
67页
需积分: 0 1 下载量 16 浏览量
更新于2024-08-26
收藏 268KB PDF 举报
mongo querydsl 官网文档
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页未读,继续阅读
资源推荐
资源评论
2021-06-14 上传
154 浏览量
5星 · 资源好评率100%
109 浏览量
200 浏览量
196 浏览量
2018-01-17 上传
2018-12-30 上传
2021-01-30 上传
2013-11-19 上传
119 浏览量
2011-10-10 上传
145 浏览量
2021-07-18 上传
2021-03-15 上传
2017-09-28 上传
143 浏览量
2021-07-16 上传
5星 · 资源好评率100%
139 浏览量
5星 · 资源好评率100%
105 浏览量
5星 · 资源好评率100%
169 浏览量
5星 · 资源好评率100%
资源评论
lxllzwj5201314
- 粉丝: 58
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功