diff --git a/README.md b/README.md
index c048b52da..514e1ef25 100644
--- a/README.md
+++ b/README.md
@@ -34,8 +34,10 @@ Free support is provided in the Querydsl Google Group https://groups.google.com/
Querydsl provides releases via public Maven repositories, but you can build the sources also yourself like this
- cd querydsl-root
- mvn -DskipTests=true clean install
+```BASH
+$ cd querydsl-root
+$ mvn -DskipTests=true clean install
+```
For more information visit the project homepage at http://www.querydsl.com/.
@@ -54,10 +56,10 @@ place it in the ```devops``` directory.
To launch the virtual machine:
-```
-$> cd devops
-devops$> librarian-puppet install
-devops$> vagrant up
+```BASH
+$ cd devops
+$ librarian-puppet install
+$ vagrant up
```
All of the databases' default ports are forwarded to the host machine. See the Vagrantfile for details.
diff --git a/querydsl-collections/README.md b/querydsl-collections/README.md
index e7b6c4c49..b1bfd73c8 100644
--- a/querydsl-collections/README.md
+++ b/querydsl-collections/README.md
@@ -6,24 +6,24 @@ The Collections module provides integration with Java Collections and Beans.
Add the following dependencies to your Maven project :
-
- com.mysema.querydsl
- querydsl-apt
- ${querydsl.version}
- provided
-
-
-
- com.mysema.querydsl
- querydsl-collections
- ${querydsl.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-apt
+ ${querydsl.version}
+ provided
+
+
+ com.mysema.querydsl
+ querydsl-collections
+ ${querydsl.version}
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
If you are not using JPA or JDO you can generate Querydsl query types for your domain types by annotating them with the com.mysema.query.annotations.QueryEntity annotation and adding the following plugin configuration into your Maven configuration (pom.xml) :
@@ -58,13 +58,15 @@ If you are not using JPA or JDO you can generate Querydsl query types for your d
Querying with Querydsl Collections is as simple as this :
- import static com.mysema.query.collections.CollQueryFactory.*;
-
- QCat cat = new QCat("cat");
- for (String name : from(cat,cats)
- .where(cat.kittens.size().gt(0))
- .list(cat.name)){
- System.out.println(name);
- }
+```JAVA
+import static com.mysema.query.collections.CollQueryFactory.*;
+
+QCat cat = new QCat("cat");
+for (String name : from(cat,cats)
+ .where(cat.kittens.size().gt(0))
+ .list(cat.name)){
+ System.out.println(name);
+}
+```
For more information on the Querydsl Collections module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s08.html
diff --git a/querydsl-jdo/README.md b/querydsl-jdo/README.md
index 850975c47..bfd46dcea 100644
--- a/querydsl-jdo/README.md
+++ b/querydsl-jdo/README.md
@@ -6,24 +6,26 @@ The JDO module provides integration with the JDO API.
Add the following dependencies to your Maven project :
-
- com.mysema.querydsl
- querydsl-apt
- ${querydsl.version}
- provided
-
-
-
- com.mysema.querydsl
- querydsl-jdo
- ${querydsl.version}
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-apt
+ ${querydsl.version}
+ provided
+
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+
+ com.mysema.querydsl
+ querydsl-jdo
+ ${querydsl.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
And now, configure the Maven APT plugin which generates the query types used by Querydsl :
@@ -66,11 +68,13 @@ Now you are able to construct JDOQL query instances and instances of the query d
Querying with Querydsl JDO is as simple as this :
- QCustomer customer = QCustomer.customer;
- JDOQuery query = new JDOQuery(pm);
- Customer bob = query.from(customer)
- .where(customer.firstName.eq("Bob"))
- .uniqueResult(customer);
- query.close();
+```JAVA
+QCustomer customer = QCustomer.customer;
+JDOQuery query = new JDOQuery(pm);
+Customer bob = query.from(customer)
+ .where(customer.firstName.eq("Bob"))
+ .uniqueResult(customer);
+query.close();
+```
For more information on the Querydsl JDO module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s02.html
diff --git a/querydsl-jpa/README.md b/querydsl-jpa/README.md
index a6500a23c..e2541f749 100644
--- a/querydsl-jpa/README.md
+++ b/querydsl-jpa/README.md
@@ -6,24 +6,26 @@ The JPA module provides integration with the JPA 2 persistence API.
Add the following dependencies to your Maven project :
-
- com.mysema.querydsl
- querydsl-apt
- ${querydsl.version}
- provided
-
-
-
- com.mysema.querydsl
- querydsl-jpa
- ${querydsl.version}
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-apt
+ ${querydsl.version}
+ provided
+
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+
+ com.mysema.querydsl
+ querydsl-jpa
+ ${querydsl.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
And now, configure the Maven APT plugin :
@@ -68,10 +70,12 @@ Now you are able to construct JPQL query instances and instances of the query do
Querying with Querydsl JPA is as simple as this :
- QCustomer customer = QCustomer.customer;
- JPAQuery query = new JPAQuery(entityManager);
- Customer bob = query.from(customer)
- .where(customer.firstName.eq("Bob"))
- .uniqueResult(customer);
-
+```JAVA
+QCustomer customer = QCustomer.customer;
+JPAQuery query = new JPAQuery(entityManager);
+Customer bob = query.from(customer)
+ .where(customer.firstName.eq("Bob"))
+ .uniqueResult(customer);
+```
+
For more information on the Querydsl JPA module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02.html#jpa_integration
diff --git a/querydsl-lucene3/README.md b/querydsl-lucene3/README.md
index b945b4c30..d47851e9b 100644
--- a/querydsl-lucene3/README.md
+++ b/querydsl-lucene3/README.md
@@ -5,36 +5,39 @@ The Lucene module provides integration with the Lucene 3 indexing library.
**Maven integration**
Add the following dependencies to your Maven project :
-
-
- com.mysema.querydsl
- querydsl-lucene3
- ${querydsl.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-lucene3
+ ${querydsl.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
**Creating the query types**
With fields year and title a manually created query type could look something like this:
-
- public class QDocument extends EntityPathBase{
- private static final long serialVersionUID = -4872833626508344081L;
-
- public QDocument(String var) {
- super(Document.class, PathMetadataFactory.forVariable(var));
- }
-
- public final StringPath year = createString("year");
-
- public final StringPath title = createString("title");
+
+```JAVA
+public class QDocument extends EntityPathBase{
+ private static final long serialVersionUID = -4872833626508344081L;
+
+ public QDocument(String var) {
+ super(Document.class, PathMetadataFactory.forVariable(var));
}
+ public final StringPath year = createString("year");
+
+ public final StringPath title = createString("title");
+}
+```
+
QDocument represents a Lucene document with the fields year and title.
Code generation is not available for Lucene, since no schema data is available.
@@ -42,17 +45,21 @@ Code generation is not available for Lucene, since no schema data is available.
**Querying**
Querying with Querydsl Lucene is as simple as this:
-
- QDocument doc = new QDocument("doc");
-
- IndexSearcher searcher = new IndexSearher(index);
- LuceneQuery query = new LuceneQuery(true, searcher);
- List documents = query
- .where(doc.year.between("1800", "2000").and(doc.title.startsWith("Huckle"))
- .list();
+
+```JAVA
+QDocument doc = new QDocument("doc");
+
+IndexSearcher searcher = new IndexSearher(index);
+LuceneQuery query = new LuceneQuery(true, searcher);
+List documents = query
+ .where(doc.year.between("1800", "2000").and(doc.title.startsWith("Huckle"))
+ .list();
+ ```
which is transformed into the following Lucene query :
-
- +year:[1800 TO 2000] +title:huckle*
+
+```
++year:[1800 TO 2000] +title:huckle*
+```
For more information on the Querydsl Lucene module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s05.html
diff --git a/querydsl-lucene4/README.md b/querydsl-lucene4/README.md
index 937607672..4a6a8f9a9 100644
--- a/querydsl-lucene4/README.md
+++ b/querydsl-lucene4/README.md
@@ -5,36 +5,38 @@ The Lucene module provides integration with the Lucene 4 indexing library.
**Maven integration**
Add the following dependencies to your Maven project :
-
-
- com.mysema.querydsl
- querydsl-lucene4
- ${querydsl.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-lucene4
+ ${querydsl.version}
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
**Creating the query types**
With fields year and title a manually created query type could look something like this:
-
- public class QDocument extends EntityPathBase{
- private static final long serialVersionUID = -4872833626508344081L;
-
- public QDocument(String var) {
- super(Document.class, PathMetadataFactory.forVariable(var));
- }
-
- public final StringPath year = createString("year");
-
- public final StringPath title = createString("title");
+
+```JAVA
+public class QDocument extends EntityPathBase{
+ private static final long serialVersionUID = -4872833626508344081L;
+
+ public QDocument(String var) {
+ super(Document.class, PathMetadataFactory.forVariable(var));
}
+ public final StringPath year = createString("year");
+
+ public final StringPath title = createString("title");
+}
+```
+
QDocument represents a Lucene document with the fields year and title.
Code generation is not available for Lucene, since no schema data is available.
@@ -42,17 +44,20 @@ Code generation is not available for Lucene, since no schema data is available.
**Querying**
Querying with Querydsl Lucene is as simple as this:
-
- QDocument doc = new QDocument("doc");
-
- IndexSearcher searcher = new IndexSearher(index);
- LuceneQuery query = new LuceneQuery(true, searcher);
- List documents = query
- .where(doc.year.between("1800", "2000").and(doc.title.startsWith("Huckle"))
- .list();
+
+```JAVA
+QDocument doc = new QDocument("doc");
+
+IndexSearcher searcher = new IndexSearher(index);
+LuceneQuery query = new LuceneQuery(true, searcher);
+List documents = query
+ .where(doc.year.between("1800", "2000").and(doc.title.startsWith("Huckle"))
+ .list();
+```
which is transformed into the following Lucene query :
-
- +year:[1800 TO 2000] +title:huckle*
+```
++year:[1800 TO 2000] +title:huckle*
+```
For more information on the Querydsl Lucene module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s05.html
diff --git a/querydsl-mongodb/README.md b/querydsl-mongodb/README.md
index 7a8c751e6..7c6ead58a 100644
--- a/querydsl-mongodb/README.md
+++ b/querydsl-mongodb/README.md
@@ -6,17 +6,19 @@ The Mongodb module provides integration with the Mongodb API.
Add the following dependencies to your Maven project :
-
- com.mysema.querydsl
- querydsl-mongodb
- ${querydsl.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-mongodb
+ ${querydsl.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
And now, configure the Maven APT plugin which generates the query types used by Querydsl :
@@ -49,7 +51,7 @@ And now, configure the Maven APT plugin which generates the query types used by
The MorphiaAnnotationProcessor finds domain types annotated with the com.google.code.morphia.annotations.Entity annotation and generates Querydsl query types for them.
-Run clean install and you will get your Query types generated into target/generated-sources/java.
+Run `clean install` and you will get your Query types generated into target/generated-sources/java.
If you use Eclipse, run mvn eclipse:eclipse to update your Eclipse project to include target/generated-sources/java as a source folder.
@@ -59,14 +61,16 @@ Now you are able to construct Mongodb queries and instances of the query domain
Querying with Querydsl Mongodb with Morphia is as simple as this :
- Morphia morphia;
- Datastore datastore;
- // ...
- QUser user = new QUser("user");
- MorphiaQuery query = new MorphiaQuery(morphia, datastore, user);
- List list = query
- .where(user.firstName.eq("Bob"))
- .list();
+```JAVA
+Morphia morphia;
+Datastore datastore;
+// ...
+QUser user = new QUser("user");
+MorphiaQuery query = new MorphiaQuery(morphia, datastore, user);
+List list = query
+ .where(user.firstName.eq("Bob"))
+ .list();
+```
For more information on the Querydsl Mongodb module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s07.html
diff --git a/querydsl-sql/README.md b/querydsl-sql/README.md
index 3b7b34809..21279a381 100644
--- a/querydsl-sql/README.md
+++ b/querydsl-sql/README.md
@@ -6,17 +6,18 @@ The SQL module provides integration with the JDBC API.
Add the following dependencies to your Maven project :
-
- com.mysema.querydsl
- querydsl-sql
- ${querydsl.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- 1.6.1
-
+```XML
+
+ com.mysema.querydsl
+ querydsl-sql
+ ${querydsl.version}
+
+
+ org.slf4j
+ slf4j-log4j12
+ 1.6.1
+
+```
**Code generation via Maven**
@@ -63,13 +64,14 @@ Use the goal test-export to add the targetFolder as a test compile source root i
**Querying**
Querying with Querydsl SQL is as simple as this :
-
- QCustomer customer = new QCustomer("c");
- SQLTemplates dialect = new HSQLDBTemplates(); // SQL-dialect
- SQLQuery query = new SQLQuery(connection, dialect);
- List lastNames = query.from(customer)
- .where(customer.firstName.eq("Bob"))
- .list(customer.lastName);
-
+```JAVA
+QCustomer customer = new QCustomer("c");
+
+SQLTemplates dialect = new HSQLDBTemplates(); // SQL-dialect
+SQLQuery query = new SQLQuery(connection, dialect);
+List lastNames = query.from(customer)
+ .where(customer.firstName.eq("Bob"))
+ .list(customer.lastName);
+```
For more information on the Querydsl SQL module visit the reference documentation http://www.querydsl.com/static/querydsl/latest/reference/html/ch02s03.html