Skip to content

Commit 1389f8e

Browse files
committed
Update README.
1 parent c4b8305 commit 1389f8e

File tree

2 files changed

+47
-31
lines changed

2 files changed

+47
-31
lines changed

README.md

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ final Transactional db = ds::getConnection;
470470

471471
The library is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
472472

473-
Copyright 2019-2021 Franz Wilhelmstötter
473+
Copyright 2019-2023 Franz Wilhelmstötter
474474

475475
Licensed under the Apache License, Version 2.0 (the "License");
476476
you may not use this file except in compliance with the License.
@@ -486,44 +486,32 @@ The library is licensed under the [Apache License, Version 2.0](http://www.apach
486486

487487
## Release notes
488488

489-
### [2.0.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.0.0)
489+
### [2.1.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.1.0)
490490

491491
#### Improvements
492492

493-
* [#21](https://github.com/jenetics/facilejdbc/issues/21): Create `Ctor` instances from Record classes. It is now possible to create `Ctor` directly from `record` classes.
493+
* [#23](https://github.com/jenetics/facilejdbc/issues/23): Implementation of `Stored` class.
494494
```java
495-
// Simple `Dctor` creation.
496-
final Dctor<Book> dctor = Dctor.of(Book.class);
495+
// Reading 'Link' objects from db.
496+
final List<Stored<Long, Link>> links = select
497+
.as(LINK_PARSER.stored("id").list(), conn);
497498

498-
// Adapt the name conversion.
499-
final Dctor<Book> dctor = Records.dctor(
500-
Book.class,
501-
component -> switch (component.getName()) {
502-
case "author" -> "primary_author";
503-
case "isbn" -> "isbn13";
504-
default -> Records.toSnakeCase(component);
505-
}
506-
);
499+
// Printing the result + its DB ids.
500+
links.forEach(System.out::println);
507501

508-
// Add additional columns.
509-
final Dctor<Book> dctor = Records.dctor(
510-
Book.class,
511-
field("title_hash", book -> book.title().hashCode())
512-
);
502+
// > Stored[id=1, value=Link[http://jenetics.io, text=null, type=null]]
503+
// > Stored[id=2, value=Link[http://jenetics.io, text=Jenetics, type=web]]
504+
// > Stored[id=3, value=Link[https://duckduckgo.com, text=DuckDuckGo, type=search]]
513505
```
514-
* [#43](https://github.com/jenetics/facilejdbc/issues/43): Create `RowParser` instances from `record` classes.
506+
* [#49](https://github.com/jenetics/facilejdbc/issues/49): Implement `PreparedQuery` class.
515507
```java
516-
// Simple `RowParser` creation.
517-
final RowParser<Book> parser = RowParser.of(Book.class);
518-
519-
// Adapting the record component parsing.
520-
final RowParser<Book> parser = Records.parserWithFields(
521-
Book.class,
522-
Map.of(
523-
"isbn", string("isbn").map(Isbn::new),
524-
"authors", int64("id").map(Author::selectByBookId)
525-
)
526-
);
508+
final var query = INSERT_LINK.prepareQuery(conn);
509+
final var batch = Batch.of(links, LINK_DCTOR);
510+
query.execute(batch);
527511
```
528512

513+
#### Bug
514+
515+
* [#23](https://github.com/jenetics/facilejdbc/issues/23): Remove wrong `null` check in `Param` factory method.
516+
529517
_[All Release Notes](RELEASE_NOTES.md)_

RELEASE_NOTES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
## Release notes
22

3+
### [2.1.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.1.0)
4+
5+
#### Improvements
6+
7+
* [#23](https://github.com/jenetics/facilejdbc/issues/23): Implementation of `Stored` class.
8+
```java
9+
// Reading 'Link' objects from db.
10+
final List<Stored<Long, Link>> links = select
11+
.as(LINK_PARSER.stored("id").list(), conn);
12+
13+
// Printing the result + its DB ids.
14+
links.forEach(System.out::println);
15+
16+
// > Stored[id=1, value=Link[http://jenetics.io, text=null, type=null]]
17+
// > Stored[id=2, value=Link[http://jenetics.io, text=Jenetics, type=web]]
18+
// > Stored[id=3, value=Link[https://duckduckgo.com, text=DuckDuckGo, type=search]]
19+
```
20+
* [#49](https://github.com/jenetics/facilejdbc/issues/49): Implement `PreparedQuery` class.
21+
```java
22+
final var query = INSERT_LINK.prepareQuery(conn);
23+
final var batch = Batch.of(links, LINK_DCTOR);
24+
query.execute(batch);
25+
```
26+
27+
#### Bug
28+
29+
* [#23](https://github.com/jenetics/facilejdbc/issues/23): Remove wrong `null` check in `Param` factory method.
30+
331
### [2.0.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.0.0)
432

533
#### Improvements

0 commit comments

Comments
 (0)