Migration4Guide
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
PrimaryKeycan haveTypeConverters, be table-based objects, and all kinds of objects. No real restrictions.ForeignKeyhave been revamped to allowstubbedRelationship. This replacesForeignKeyContainer.Modelinterface now includesload()to enabled reloading very easily when fields change.All
ModelContainerimplementation + 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
Modelrestriction on tables. If you leave out extendingBaseModel, you must interact with theModelAdapter.We generate much less less code than 3.0. Combined the
_Table+_Adapterinto the singular_Tableclass, which contains bothProperty+ all of the regularModelAdaptermethods. To ease the transition to 4.0, it is named_Tablebut extendsModelAdapter. So most use cases / interactions will not break.Conditionare nowOperator, this includesSQLCondition->SQLOperator,ConditionGroup->OperatorGroup.Operatorare now typed and safer to use. 1.Operatornow also havediv,times,rem,plusandminusmethods.Property class changes: 1. All primitive
Propertyclasses have been removed. We already boxed the values internally anyways so removing them cut down on method count and maintenance. 2.BasePropertyno longer needs to exist, so all of it's methods now exist inProperty3.modmethod is nowrem(remainder) method to match Kotlin 1.1's changes. 4.dividedByis nowdivto match Kotlin operators. 5.multipliedByis nowtimesto 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/Modelat all anymore if you so choose. There areModel-like extension methods that supply theModelmethods. 3. Updated to version 1.1.1RXJava1 and RXJava2 support! Can now write queries that return
Observableand more.
Last updated
Was this helpful?