In 4.0, DBFlow has greatly improved its internals and flexibility in this release. We have removed the Model
restriction, rewritten the annotation processor completely in Kotlin, and more awesome improvements.
Major Changes In this release
PrimaryKey
can haveTypeConverters
, be table-based objects, and all kinds of objects. No real restrictions.ForeignKey
have been revamped to allowstubbedRelationship
. This replacesForeignKeyContainer
.Model
interface now includesload()
to enabled reloading very easily when fields change.- All
ModelContainer
implementation + support has been removed. A few reasons pushed the removal, including implementation. Since removing support, the annotation processor is cleaner, easier to maintain, and more streamlined. Also the support for it was not up to par, and by removing it, we can focus on improving the quality of the other features. - The annotation processor has been rewritten in Kotlin! By doing so, we reduced the code by ~13%.
- Removed the
Model
restriction on tables. If you leave out extendingBaseModel
, you must interact with theModelAdapter
. - We generate much less less code than 3.0. Combined the
_Table
+_Adapter
into the singular_Table
class, which contains bothProperty
+ all of the regularModelAdapter
methods. To ease the transition to 4.0, it is named_Table
but extendsModelAdapter
. So most use cases / interactions will not break. Condition
are nowOperator
, this includesSQLCondition
->SQLOperator
,ConditionGroup
->OperatorGroup
.Operator
are now typed and safer to use. 1.Operator
now also havediv
,times
,rem
,plus
andminus
methods.- Property class changes: 1. All primitive
Property
classes have been removed. We already boxed the values internally anyways so removing them cut down on method count and maintenance. 2.BaseProperty
no longer needs to exist, so all of it's methods now exist inProperty
3.mod
method is nowrem
(remainder) method to match Kotlin 1.1's changes. 4.dividedBy
is nowdiv
to match Kotlin operators. 5.multipliedBy
is nowtimes
to match Kotlin operators. - Rewrote all Unit tests to be more concise, better tested, and cleaner.
- A lot of bug fixes
- Kotlin: 1. Added more Kotlin extensions. 2. Most importantly you don't need to use
BaseModel
/Model
at all anymore if you so choose. There areModel
-like extension methods that supply theModel
methods. 3. Updated to version 1.1.1 - RXJava1 and RXJava2 support! Can now write queries that return
Observable
and more.