Skip to content

Commit

Permalink
Update floor version to 0.13.0 & update README.md for implementing em…
Browse files Browse the repository at this point in the history
…bedded objects
  • Loading branch information
hsul4n committed May 13, 2020
1 parent aaa00be commit 233dec0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
6 changes: 6 additions & 0 deletions floor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

# 0.13.0

### 🚀 Features

* Support embedded objects

# 0.12.0

### Changes
Expand Down
14 changes: 13 additions & 1 deletion floor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ For more information about primary keys and especially compound primary keys, re
`@ColumnInfo` enables custom mapping of single table columns.
With the annotation, it's possible to give columns a custom name and define if the column is able to store `null`.

`@Embedded` includes annotationed class fields to be embedded to SQL query as if they are fields but from another class.
You can specifies a `prefix` to prepend the column names of the fields in the embedded fields.

#### Limitations
- Floor automatically uses the **first** constructor defined in the entity class for creating in-memory objects from database rows.
- There needs to be a constructor.
Expand All @@ -210,7 +213,16 @@ class Person {
@ColumnInfo(name: 'custom_name', nullable: false)
final String name;
Person(this.id, this.name);
@Embedded(prefix: 'custom_prefix')
final Address address;
Person(this.id, this.name, this.address);
}
class Address {
final String street;
Address(this.street);
}
```

Expand Down
2 changes: 1 addition & 1 deletion floor/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: floor
description: >
A supportive SQLite abstraction for your Flutter applications.
This library is the runtime dependency.
version: 0.12.0
version: 0.13.0
homepage: https://github.com/vitusortner/floor
author: Vitus Ortner <[email protected]>

Expand Down

0 comments on commit 233dec0

Please sign in to comment.