Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jenetics committed Nov 15, 2023
1 parent c4b8305 commit 1389f8e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 31 deletions.
50 changes: 19 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ final Transactional db = ds::getConnection;

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

Copyright 2019-2021 Franz Wilhelmstötter
Copyright 2019-2023 Franz Wilhelmstötter

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

## Release notes

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

#### Improvements

* [#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.
* [#23](https://github.com/jenetics/facilejdbc/issues/23): Implementation of `Stored` class.
```java
// Simple `Dctor` creation.
final Dctor<Book> dctor = Dctor.of(Book.class);
// Reading 'Link' objects from db.
final List<Stored<Long, Link>> links = select
.as(LINK_PARSER.stored("id").list(), conn);

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

// Add additional columns.
final Dctor<Book> dctor = Records.dctor(
Book.class,
field("title_hash", book -> book.title().hashCode())
);
// > Stored[id=1, value=Link[http://jenetics.io, text=null, type=null]]
// > Stored[id=2, value=Link[http://jenetics.io, text=Jenetics, type=web]]
// > Stored[id=3, value=Link[https://duckduckgo.com, text=DuckDuckGo, type=search]]
```
* [#43](https://github.com/jenetics/facilejdbc/issues/43): Create `RowParser` instances from `record` classes.
* [#49](https://github.com/jenetics/facilejdbc/issues/49): Implement `PreparedQuery` class.
```java
// Simple `RowParser` creation.
final RowParser<Book> parser = RowParser.of(Book.class);

// Adapting the record component parsing.
final RowParser<Book> parser = Records.parserWithFields(
Book.class,
Map.of(
"isbn", string("isbn").map(Isbn::new),
"authors", int64("id").map(Author::selectByBookId)
)
);
final var query = INSERT_LINK.prepareQuery(conn);
final var batch = Batch.of(links, LINK_DCTOR);
query.execute(batch);
```

#### Bug

* [#23](https://github.com/jenetics/facilejdbc/issues/23): Remove wrong `null` check in `Param` factory method.

_[All Release Notes](RELEASE_NOTES.md)_
28 changes: 28 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
## Release notes

### [2.1.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.1.0)

#### Improvements

* [#23](https://github.com/jenetics/facilejdbc/issues/23): Implementation of `Stored` class.
```java
// Reading 'Link' objects from db.
final List<Stored<Long, Link>> links = select
.as(LINK_PARSER.stored("id").list(), conn);

// Printing the result + its DB ids.
links.forEach(System.out::println);

// > Stored[id=1, value=Link[http://jenetics.io, text=null, type=null]]
// > Stored[id=2, value=Link[http://jenetics.io, text=Jenetics, type=web]]
// > Stored[id=3, value=Link[https://duckduckgo.com, text=DuckDuckGo, type=search]]
```
* [#49](https://github.com/jenetics/facilejdbc/issues/49): Implement `PreparedQuery` class.
```java
final var query = INSERT_LINK.prepareQuery(conn);
final var batch = Batch.of(links, LINK_DCTOR);
query.execute(batch);
```

#### Bug

* [#23](https://github.com/jenetics/facilejdbc/issues/23): Remove wrong `null` check in `Param` factory method.

### [2.0.0](https://github.com/jenetics/facilejdbc/releases/tag/v2.0.0)

#### Improvements
Expand Down

0 comments on commit 1389f8e

Please sign in to comment.