[#6370] Improve misleading MockDataProvider example in the manual
This commit is contained in:
parent
35b6b21c88
commit
d3d66edacf
@ -10196,9 +10196,9 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
mock[0] = new MockResult(1, result);
|
||||
|
||||
@ -10760,9 +10760,9 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
mock[0] = new MockResult(1, result);
|
||||
|
||||
@ -18235,11 +18235,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -11570,9 +11570,9 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
mock[0] = new MockResult(1, result);
|
||||
|
||||
@ -12401,11 +12401,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -13783,11 +13783,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -14490,11 +14490,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -15460,11 +15460,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -15903,11 +15903,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -16176,11 +16176,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
@ -17825,11 +17825,11 @@ Result<BookRecord> result = create.selectFrom(BOOK).where(BOOK.ID.eq(5)).fetch()
|
||||
// You decide, whether any given statement returns results, and how many
|
||||
else if (sql.toUpperCase().startsWith("SELECT")) {
|
||||
|
||||
// Always return one author record
|
||||
Result<AuthorRecord> result = create.newResult(AUTHOR);
|
||||
result.add(create.newRecord(AUTHOR));
|
||||
result.get(0).setValue(AUTHOR.ID, 1);
|
||||
result.get(0).setValue(AUTHOR.LAST_NAME, "Orwell");
|
||||
// Always return one record
|
||||
Result<Record2<Integer, String>> result = create.newResult(AUTHOR.ID, AUTHOR.LAST_NAME);
|
||||
result.add(create
|
||||
.newRecord(AUTHOR.ID, AUTHOR.LAST_NAME)
|
||||
.values(1, "Orwell"));
|
||||
mock[0] = new MockResult(1, result);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user