From b481ab12c05796edfa607041d93697917eda7684 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Tue, 9 May 2017 11:40:53 +0200 Subject: [PATCH] [#6194] Add a section to the manual about the Query By Example API --- .../resources/org/jooq/web/manual-3.8.xml | 48 +++++++++++++++++++ .../resources/org/jooq/web/manual-3.9.xml | 48 +++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml index e7b4458d7a..bb89521162 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.8.xml @@ -8424,6 +8424,54 @@ row(Date.valueOf('2010-01-01'), new DayToSecond(2)).overlaps(Date.valueOf('2010- (C <= B) AND (A <= D)]]> + +
+ Query By Example (QBE) + +

+ A popular approach to querying database tables is called Query by Example, meaning that an "example" of a result record is provided instead of a formal query: +

+ + + + + +

+ The translation from an example record to a query is fairly straight-forward: +

+ +
    +
  • If a record attribute is set to a value, then that value is used for an equality predicate
  • +
  • If a record attribute is not set, then that attribute is not used for any predicates
  • +
+ +

+ jOOQ knows a simple API called , which translates a to a : +

+ + books = +DSL.using(configuration) + .selectFrom(BOOK) + .where(condition(book)) + .fetch();]]> +
+
diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml index 55278bb05e..c152d78401 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml +++ b/jOOQ-manual/src/main/resources/org/jooq/web/manual-3.9.xml @@ -8477,6 +8477,54 @@ row(Date.valueOf('2010-01-01'), new DayToSecond(2)).overlaps(Date.valueOf('2010- (C <= B) AND (A <= D)]]> + +
+ Query By Example (QBE) + +

+ A popular approach to querying database tables is called Query by Example, meaning that an "example" of a result record is provided instead of a formal query: +

+ + + + + +

+ The translation from an example record to a query is fairly straight-forward: +

+ +
    +
  • If a record attribute is set to a value, then that value is used for an equality predicate
  • +
  • If a record attribute is not set, then that attribute is not used for any predicates
  • +
+ +

+ jOOQ knows a simple API called , which translates a to a : +

+ + books = +DSL.using(configuration) + .selectFrom(BOOK) + .where(condition(book)) + .fetch();]]> +
+