You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A robust, powerful, and very simple ORM android database library with **annotation processing**.
6
6
@@ -10,15 +10,13 @@ Let DBFlow make SQL code _flow_ like a _steady_ stream so you can focus on writi
10
10
11
11
# Why Use DBFlow vs other solutions
12
12
DBFlow was built with the intention of bringing the best of all features from other ORM database libraries and to do it even better. It was also built to not limit how you can code your problems, but make it _significantly_ easier to make amazing applications. Don't let an ORM or library get in your way, let the code you write in your applications be the best as possible.
13
-
14
-
1.**Extensibility**: `Model` is just an interface, no subclass required, but as a convenience we recommend using `BaseModel`. You can extend non-`Model` classes in different packages and use them as your DB tables. Also you can subclass other `Model` to join the `@Column` together, and again they can be in different packages. _Also, subclass objects in this library to suit your needs_.
15
-
16
-
2.**Speed**: Built with java's annotation processing code generation, there's zero runtime performance hit by using this library. This library saves hours of boilerplate code and maintenance by generating the code for you. With powerful model caching (multiple primary key `Model` too), you can surpass the speed of SQLite by reusing where possible. We have support for lazy-loading relationships on-demand such as `@ForeignKey` or `@OneToMany` that make queries happen super-fast.
17
-
3.**SQLite Query Flow**: The queries in this library adhere as closely as possible to SQLite native queries. `select(name, screenSize).from(Android.class).where(name.is("Nexus 5x")).and(version.is(6.0)).querySingle()`
18
-
4.**Open Source**: This library is fully open source and contributions are not only welcomed, but encouraged.
19
-
5.**Robust**: We support `Trigger`, `ModelView`, `Index`, `Migration`, built-in database request queue to perform operations on same thread, and many more features.
20
-
6.**Multiple Databases, Multiple Modules**: we seamlessly support multiple database files, database modules using DBFlow in other dependencies, simultaneously.
21
-
7.**Built On SQLite**: SQLite is the most widely used database engine in world and using it as your base, you are not tied to a limited set of platforms or libraries.
13
+
-**Extensibility**: `Model` is just an interface, no subclass required, but as a convenience we recommend using `BaseModel`. You can extend non-`Model` classes in different packages and use them as your DB tables. Also you can subclass other `Model` to join the `@Column` together, and again they can be in different packages. _Also, subclass objects in this library to suit your needs_.
14
+
-**Speed**: Built with java's annotation processing code generation, there's zero runtime performance hit by using this library. This library saves hours of boilerplate code and maintenance by generating the code for you. With powerful model caching (multiple primary key `Model` too), you can surpass the speed of SQLite by reusing where possible. We have support for lazy-loading relationships on-demand such as `@ForeignKey` or `@OneToMany` that make queries happen super-fast.
15
+
-**SQLite Query Flow**: The queries in this library adhere as closely as possible to SQLite native queries. `select(name, screenSize).from(Android.class).where(name.is("Nexus 5x")).and(version.is(6.0)).querySingle()`
16
+
-**Open Source**: This library is fully open source and contributions are not only welcomed, but encouraged.
17
+
-**Robust**: We support `Trigger`, `ModelView`, `Index`, `Migration`, built-in database request queue to perform operations on same thread, and many more features.
18
+
-**Multiple Databases, Multiple Modules**: we seamlessly support multiple database files, database modules using DBFlow in other dependencies, simultaneously.
19
+
-**Built On SQLite**: SQLite is the most widely used database engine in world and using it as your base, you are not tied to a limited set of platforms or libraries.
22
20
23
21
# Changelog
24
22
# 3.0-beta1
@@ -91,7 +89,7 @@ Add the library to the project-level build.gradle, using the to enable Annotati
91
89
92
90
apply plugin: 'com.neenbedankt.android-apt'
93
91
94
-
def dbflow_version = "3.0.0-beta1"
92
+
def dbflow_version = "3.0.0-beta2"
95
93
// or dbflow_version = "develop-SNAPSHOT" for grabbing latest dependency in your project on the develop branch
96
94
97
95
dependencies {
@@ -105,11 +103,11 @@ You can also specify a commit hash instead of `develop-SNAPSHOT` to grab a speci
105
103
106
104
# Pull Requests
107
105
I welcome and encourage all pull requests. It usually will take me within 24-48 hours to respond to any issue or request. Here are some basic rules to follow to ensure timely addition of your request:
108
-
1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
109
-
2. If its a feature, bugfix, or anything please only change code to what you specify.
110
-
3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
111
-
4. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.
112
-
5. Have fun!
106
+
1. Match coding style (braces, spacing, etc.) This is best achieved using CMD+Option+L (Reformat code) on Mac (not sure for Windows) with Android Studio defaults.
107
+
2. If its a feature, bugfix, or anything please only change code to what you specify.
108
+
3. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
109
+
4. Pull requests _must_ be made against `develop` branch. Any other branch (unless specified by the maintainers) will get rejected.
Copy file name to clipboardExpand all lines: usage/Migration3Guide.md
+20-20Lines changed: 20 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,18 @@ DBFlow has undergone the most _significant_ changes in its lifetime in 3.0. This
4
4
A significant portion of the changes include the _complete_ overhaul of the underlying annotation processor, leading to wonderful improvements in maintainability of the code, readability, and stability of the generated code. Now it uses the updated [JavaPoet](https://github.com/square/javapoet) vs the outdated JavaWriter. The changes in this library alone _significantly_ helps out the stability of the generated code.
5
5
6
6
_note:_
7
-
1.`update` no longer attempts to `insert` if it fails.
8
-
2. Package private fields from other packages are now automatically accessible via generated `_Helper` classes. The referenced fields must be annotated with `@Column`, `@PrimaryKey`, or `@ForeignKey`. if its a legacy `ForeignKeyReference`, `referendFieldIsPackagePrivate()` must be set to true.
9
-
3.`@Column` no longer required in conjunction with `@PrimaryKey` or `@ForeignKey`
10
-
4. Can now have DBFlow in multiple modules, libraries, etc via "Modules"!
7
+
1.`update` no longer attempts to `insert` if it fails.
8
+
2. Package private fields from other packages are now automatically accessible via generated `_Helper` classes. The referenced fields must be annotated with `@Column`, `@PrimaryKey`, or `@ForeignKey`. if its a legacy `ForeignKeyReference`, `referendFieldIsPackagePrivate()` must be set to true.
9
+
3.`@Column` no longer required in conjunction with `@PrimaryKey` or `@ForeignKey`
10
+
4. Can now have DBFlow in multiple modules, libraries, etc via "Modules"!
11
11
12
12
## Table Of Contents
13
-
1. Database + Table Structure
14
-
2. Properties, Conditions, Queries, Replacement of ConditionQueryBuilder and more
15
-
3. ModelContainers
16
-
4. ModelViews
17
-
5. Caching
18
-
6. Database Modules
13
+
1. Database + Table Structure
14
+
2. Properties, Conditions, Queries, Replacement of ConditionQueryBuilder and more
15
+
3. ModelContainers
16
+
4. ModelViews
17
+
5. Caching
18
+
6. Database Modules
19
19
20
20
## Database + Table Structure
21
21
### Database changes
@@ -296,16 +296,16 @@ SQLite.select()
296
296
297
297
## ModelContainerChanges
298
298
Now `ModelContainer` objects have a multitude of type-safe methods to ensure that they can convert their contained object's data into the field they associate with. What this means is that if our `Model` has a `long` field, while the data object for the `ModelContainer` has a `Integer` object. Previously, we would get a classcastexception. Now what it does is "coerce" the value into the type you need. Supported Types:
299
-
1. Integer/int
300
-
2. Double/Double
301
-
3. Boolean/boolean
302
-
4. Short/short
303
-
5. Long/long
304
-
6. Float/Float
305
-
7. String
306
-
8. Blob/byte[]/Byte[]
307
-
9. Byte/byte
308
-
10. Using TypeConverter to retrieve value safely.
299
+
1. Integer/int
300
+
2. Double/Double
301
+
3. Boolean/boolean
302
+
4. Short/short
303
+
5. Long/long
304
+
6. Float/Float
305
+
7. String
306
+
8. Blob/byte[]/Byte[]
307
+
9. Byte/byte
308
+
10. Using TypeConverter to retrieve value safely.
309
309
310
310
You can now `queryModelContainer` from the database to retrieve a single `Model` into `ModelContainer` format instead of into `Model` and then `ModelContainer`:
0 commit comments