Querydsl

compared with
Current by Timo Westkämper
on Sep 06, 2010 15:19.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 30 changes. View first change.

 {section}
 {column:width=70%}
  
h2. Querydsl - Typesafe queries for Java
  
Easy and safe to use, the right tool for Adaptive Domain Development.
  {column:width=60%}
  
 h2. Description
  
Querydsl (spell: query diesel) is a framework which enables the construction of statically typed SQL-like queries. Instead of writing queries as inline strings or externalizing them into XML files they can be constructed via a fluentDSL/API like Querydsl.
  Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, JDO and SQL.
  
Instead of writing queries as inline strings or externalizing them into XML files they are constructed via a fluent API.
  
 The benefits of using a fluent API in comparison to simple strings are
 * code completion in IDE (all properties, methods and operations can be expanded in your favorite Java IDE)
* almost none syntactically invalid queries allowed (type-safe on all levels)
 * domain types and properties can be referenced safely (no Strings involved!)
  * almost no syntactically invalid queries allowed (type-safe on all levels)
 * domain types and properties can be referenced safely (no Strings involved\!)
 * adopts better to refactoring changes in domain types
* incremental Query defintion is easier
  * incremental Query definition is easier
  
h2. Modules
  
 || Module \\ || description \\ || artifactId\\ || depends on \\ ||
 | *Core* \\ | core API of Querydsl \\ | querydsl-core\\ | |
 | *APT* \\ | APT based code generation \\ | querydsl-apt\\ | Core \\ |
 | *SQL* \\ | JDBC/SQL support \\ | querydsl-sql\\ | Core, APT \\ |
 | *Lucene* \\ | Lucene support \\ | querydsl-lucene\\ | Core \\ |
 | *Collections* \\ | Java collections support \\ | querydsl-collections\\ | Core \\ |
 | *HQL* \\ | HQL/JPQL support \\ | querydsl-hql\\ | Core, APT, SQL \\ |
 | *JDOQL* \\ | JDOQL support \\ | querydsl-jdoql\\ | Core, APT |
 | *Hibernate Search* \\ | Hibernate Search support \\ | querydsl-hibernate-search\\ | Core, Lucene \\ |
  
 h2. Supported backends
  
h3. *JPA / Hibernate*
  h3. *JPA / Hibernate*
  
 * [Getting started with Querydsl using Hibernate|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02s02.html]
 * via the querydsl-hql module
 * tested with [Hibernate|https://www.hibernate.org/] using Derby, HSQLDB and MySQL
* [Getting started with Querydsl using Hibernate|http://source.mysema.com/static/querydsl/1.1.0/reference/html/ch02s02.html]
  
h3. *JDO*
 * via the querydsl-jdoql module
  h3. *JDO*
  
 * [Getting started with Querydsl using JDO|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02.html]
 * via the querydsl-jdoql module
 * tested with [DataNucleus Access Platform|http://www.datanucleus.org/]
* [Getting started with Querydsl using JDO|http://source.mysema.com/static/querydsl/1.1.0/reference/html/ch02.html]
  
h3. *Java Collections*
 * via the querydsl-collections module
 * [Getting started using Querydsl for Collections|http://source.mysema.com/static/querydsl/1.1.0/reference/html/ch02s03.html]
  h3. *Java Collections*
  
h3. *SQL*
 * via the querydsl-sql module
 * tested with Derby, HSQLDB and MySQL
  * [Getting started using Querydsl for Collections|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02s03.html]
 * via the querydsl-collections module
  
h3. *RDF*
  h3. *SQL*
  
 * [Getting started using Querydsl for SQL|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02s04.html]
 * via the querydsl-sql module
 * supports Derby, HSQLDB, MySQL (5.1), Postgres (8.4), Oracle (10/11) and MS SQL Server (2008)
  
 h3. *RDF*
  
 * via *[RDFBean|rdfbean:RDFBean]*, our Object/RDF persistence framework
 * tested with [RDFBean|http://source.mysema.com/display/rdfbean/RDFBean] using [Sesame|http://wiki.aduna-software.org/confluence/display/SESDOC/Home]
  
h3. *Lucene*
  
 * [Getting started using Querydsl for Lucene|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02s05.html]
 * via the querydsl-lucene module
  
 h3. *Hibernate Search*
  
 * [Getting started using Querydsl for Hibernate Search|http://source.mysema.com/static/querydsl/1.8.0/reference/html/ch02s06.html]
 * via the querydsl-hibernate-search module
  
 Go to *[Documentation]* for Javadocs and the Reference Documentation and go to *[Examples]* to see examples.
  
 {column}
  
{column:width=30%}
  {column:width=40%}
  
 h2. In a nutshell
  
 || Name | Querydsl ||
|| Most Recent Version | 1.1.0 ||
 || Javadocs | [v 1.1.0|http://source.mysema.com/static/querydsl/latest/apidocs] ||
  || Most Recent Version | 1.9.5 ||
 || Javadocs | [v 1.9.5|http://source.mysema.com/static/querydsl/1.9.5/apidocs] ||
 || Documentation | [Documentation] ||
|| Downloads | [Downloads] ||
 || State | {color:green}Stable{color} ||
 || License | LGPL v2.1 ||
 || Version Control | [on Mysema Source|https://source.mysema.com/svn/mysema/projects/querydsl/] ||
 || Maven repo | [on Mysema Source|http://source.mysema.com/maven2/releases] ||
 || Issue Management | [on Launchpad|https://bugs.launchpad.net/querydsl] ||
 || Commercial Support | [contact us|mailto:info@mysema.com] ||
  
h3. Got issues with Querydsl?
  h2. Querydsl users talking
  
Post a bug on *[Launchpad|https://bugs.launchpad.net/querydsl]* or ask a question in the *[Forum|http://source.mysema.com/forum/mvnforum/index]*.
  "If you are using JPA and want to write typesafe queries in an IDE, then stop using the JPA 2.0 Criteria API and start using Querydsl. Today."
  
{socialbookmarks}
  [Bob Walker|http://rjewalker.blogspot.com/2010/06/querydsl-vs-jpa-20-criteria-api-first.html]
  
"So, here is my tip to anyone thinking about using a Criteria API: Give Querydsl a try! By the way, did I mention that it can also be used with JDO, Lucene, JDBC and even plain collections? "
  
h2. User comments
  [Luis Fernando Planella Gonzalez|http://luisfpg.blogspot.com/2010/05/jpa-2-criteria.html]
  
Go [here|User comments] for User comments.
  "Querydsl rocks! It's the best thing since sliced bread for data access in Java."
  
[Alex Besogonov|http://source.mysema.com/forum/mvnforum/viewthread_thread,23]
  
{column}
 {section}
  "Using querydsl you keep the reference to your HibernateQuery object and you can apply as many joins, wheres etc as you can, in any order, so that you can get a totally mutable hql query without ugly string concatenation. "
  
[Lukasz Wisniewski|https://answers.launchpad.net/querydsl/+question/92766]
  
"Querydsl has been easy to get running, and easy to write compact and readable queries in. Integration in an existing project has been as painless as it could be, and we have had almost no problems."
  
 [Stein Magnus Jodal|http://daim.idi.ntnu.no/masteroppgave?id=4414]
  
 h2. Got issues with Querydsl?
  
 Post a bug on *[Launchpad|https://bugs.launchpad.net/querydsl]* or ask a question in the *[Forum|http://source.mysema.com/forum/mvnforum/index]*.
  
 {socialbookmarks}
  
 {column}
 {section}