From 3f739d86c120f89e65085daef05f5a4f55843a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Thu, 21 May 2009 18:44:29 +0000 Subject: [PATCH] --- querydsl-root/pom.xml | 8 ++ querydsl-root/src/site/site.xml | 30 ------ querydsl-root/src/site/xdoc/apt-options.xml | 31 ------ .../src/site/xdoc/getting-started.xml | 101 ------------------ querydsl-root/src/site/xdoc/index.xml | 56 ---------- querydsl-root/src/site/xdoc/modules.xml | 22 ---- 6 files changed, 8 insertions(+), 240 deletions(-) delete mode 100644 querydsl-root/src/site/site.xml delete mode 100644 querydsl-root/src/site/xdoc/apt-options.xml delete mode 100644 querydsl-root/src/site/xdoc/getting-started.xml delete mode 100644 querydsl-root/src/site/xdoc/index.xml delete mode 100644 querydsl-root/src/site/xdoc/modules.xml diff --git a/querydsl-root/pom.xml b/querydsl-root/pom.xml index 3f895ef7c..efcaaed0f 100644 --- a/querydsl-root/pom.xml +++ b/querydsl-root/pom.xml @@ -112,6 +112,14 @@ + + org.apache.maven.plugins + maven-eclipse-plugin + 2.6 + + none + + org.apache.maven.plugins maven-javadoc-plugin diff --git a/querydsl-root/src/site/site.xml b/querydsl-root/src/site/site.xml deleted file mode 100644 index cb8d778df..000000000 --- a/querydsl-root/src/site/site.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - /images/logos/header_mysema_logo.png - http://source.mysema.com - - - - ${project.name} - /index.html - - - - - - - - - - - - - - - - - - - - diff --git a/querydsl-root/src/site/xdoc/apt-options.xml b/querydsl-root/src/site/xdoc/apt-options.xml deleted file mode 100644 index 23ae07fb2..000000000 --- a/querydsl-root/src/site/xdoc/apt-options.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - Timo Westkämper - APT options - - -
- - - The APT options for Querydsl are -
    -
  • destClass : destination class for query domain types (inner class switch)
  • -
  • destPackage : destination package for query domain types (outer class switch)
  • -
  • dtoClass : destination class for query DTO types (inner class switch)
  • -
  • dtoPackage : destination package for query DTO types (outer class switch)
  • -
  • include : file path for class content of destClass
  • -
  • namePrefix : prefix for query domain type simplenames
  • -
- - -
- - -
\ No newline at end of file diff --git a/querydsl-root/src/site/xdoc/getting-started.xml b/querydsl-root/src/site/xdoc/getting-started.xml deleted file mode 100644 index 8e5929d1d..000000000 --- a/querydsl-root/src/site/xdoc/getting-started.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - Timo Westkämper - Getting started - - - -
-

- The basic steps to get Querydsl working in your project are the following : -

    -
  • Add the main Querydsl dependencies into your project pom : querydsl-hql (default scope) and querydsl-apt (provided scope)
  • - -
  • Add the following plugin configuration - - <plugin> - <groupId>org.apache.myfaces.tobago</groupId> - <artifactId>maven-apt-plugin</artifactId> - <version>1.0.15</version> - <executions> - <execution> - <phase>generate-sources</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <force>true</force> - <fork>true</fork> - <factory>com.mysema.query.apt.APTFactory</factory> - <generated>target/generated-sources/java</generated> - <nocompile>true</nocompile> - <A> - -AdestClass=com.mysema.someproject.dao.domain.Domain, - -AdtoClass=com.mysema.someproject.dao.domain.Dtos - </A> - <includes> - <include> - com/mysema/someproject/dao/domain/*.java - </include> - <include>com/mysema/someproject/ui/dto/*.java</include> - </includes> - </configuration> - </execution> - </executions> - </plugin> - - The APT-plugin generates Querydsl domain types into the class specified after -AdestClass= and Querydsl DTO types - into -AdtoClass=. DTO types in your project domain need to be annotated with com.mysema.query.annotations.DTO and - for project domain types standard Hibernate annotations are used. -
  • - -
  • - You can now create Querydsl domain type instances like this : - - - protected final Domain.Address address = new Domain.Address("address"); - - protected final Domain.Bookmark bookmark = new Domain.Bookmark("bookmark"); - - protected final Domain.NetworkLink nl = new Domain.NetworkLink("nl"); - - protected final Domain.Subscription sub = new Domain.Subscription("sub"); - - protected final Domain.Tag tag1 = new Domain.Tag("tag1"); - - - and reference them in your queries like this - - - public SearchResults<Bookmark> findBookmarksWithTags(String[] tagNames, - QueryModifiers mod) { - return select(distinct(bookmark)).from(bookmark) - .innerJoin(FETCH, bookmark.address) - .innerJoin(bookmark.tags.as(tag1)) - .where(tag1.name.in(tagNames)) - .orderBy(bookmark.created.desc()).restrict(mod).listResults(); - } - - protected <RT> HqlQuery<RT> select(Expr<RT> s){ - return new HqlQuery<RT>(currentSession()).select(s); - } - - - - The method distinct is taken via a static import from com.mysema.query.grammar.HqlGrammar -
  • -
-

- -

- For more examples on how to use the Querydsl API visit the API docs of the querydsl-core and querydsl-hql modules - or look through the examples in the source code. -

- -

- Feel also free to contact us if you need any help. -

-
- - -
\ No newline at end of file diff --git a/querydsl-root/src/site/xdoc/index.xml b/querydsl-root/src/site/xdoc/index.xml deleted file mode 100644 index 08d054e36..000000000 --- a/querydsl-root/src/site/xdoc/index.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - Timo Westkämper - Querydsl - - -
-

- 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 - fluent - DSL/API like Querydsl. -

- -

- The benefits of using a fluent API in comparison to simple strings are -

    -
  • code completion in IDE
  • -
  • almost none syntactically invalid queries allowed
  • -
  • domain types and properties can be referenced safely
  • -
  • adopts better to refactoring changes in domain types
  • -
-

- -

- Here a quick example for the impatient ones : - - public SearchResults<Bookmark> findBookmarksWithTags(String[] tagNames, - QueryModifiers mod) { - return select(distinct(bookmark)).from(bookmark) - .innerJoin(FETCH, bookmark.address) - .innerJoin(bookmark.tags.as(tag1)) - .where(tag1.name.in(tagNames)) - .orderBy(bookmark.created.desc()).restrict(mod).listResults(); - } - - which represents the followoing HQL query - - - select distinct bookmark from Bookmark bookmark - inner join fetch bookmark.address - inner join bookmark.tags as tag1 - where tag1.name in :tagNames - order by bookmark.created desc - - -

- -

- More examples of Hibernate queries and their Querydsl equivalents can be found - here. -

-
- - -
\ No newline at end of file diff --git a/querydsl-root/src/site/xdoc/modules.xml b/querydsl-root/src/site/xdoc/modules.xml deleted file mode 100644 index 92c7a476b..000000000 --- a/querydsl-root/src/site/xdoc/modules.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - Timo Westkämper - Modules - - - -
-

- Querydsl is based on various modules with different purposes. The modules are -

-

-
- - -
\ No newline at end of file