Skip to content

3.0.0-beta4

Pre-release
Pre-release
Compare
Choose a tag to compare
@agrosner agrosner released this 03 Mar 16:02
· 1425 commits to master since this release

This release contains a few major updates.

  1. All unit tests are now run in JVM via Robolectric
  2. @ForeignKey now saveForeignKeyModel=false by default, since this can lead to errors or unexplained performance hits. Rather be safe to be explicit!
  3. @ManyToMany can now specify the name of the generated join table. Also they can point to themselves (i.e. User_User). Also can configure saveForeignKeyModels() for each generated @ForeignKey.
  4. @ContentProvider generated now call down directly to the corresponding database methods. This is to simplify and prevent most other issues from coming up.
  5. Now there's an incubating dbflow-kotlinextensions! It provides some Kotlin language features such as items.processInTransactionAsync { it.save() } or 5.property.eq(SomeTable_Table.num)
  6. Migration no longer require empty constructor, but also support, since this led to hard-to-find compile time errors for some people:
    public TestMigration(Class<TestModel1> table) {
        super(table);
    }
  1. Versions of 3.0.0-beta1 - 3.0.0-beta3 incorrectly created tables that specified autoincrement=true. What happened is that it treated them like a ROWID. This is fixed in this version, and to fix it for any existing table, you must include and subclass the included migration snippet here. It will run a one-time migration check if you had used this in earlier versions of the 3.0 lib. If it doesn't affect you or seem to notice, a new rowID param has been added to the @PrimaryKey annotation that will keep the existing way (to prevent inconsistencies).
  2. all wrapper queries now have access to hasData() which returns count() > 0.
  3. All saving, updating, deleting, and inserting is now done via a configurable ModelSaver class. All corresponding SqlUtils static methods have been deprecated. To specify your own subclass for any extra behavior:
FlowManager.getModelAdapter(SomeTable.class).setModelSaver(new MySubclassModelSaver());

// this might need to get configured for the corresponding `ModelContainerAdapter` if you use `@ModelContainer`.
FlowManager.getContainerAdapter(SomeTable.class).setModelSaver(new MyModelContainerSubclassModelSaver());
  1. Fix issues with TypeConverter that used Blob as its database class. Properly convert the blob to a hex string using a super-efficient algorithm.
  2. Fixed null values as strings that would insert 'null' instead of the database NULL, which could lead to head-scratching why a query like SQLite.delete(SomeTable.class).where(SomeTable_Table.column.eq(null)).execute() would fail to delete in some scenarios.
  3. _Table classes now give you access to an array of IProperty from the table via getAllColumnProperties(). Useful in queries or table information.
  4. Can attached queries as properties now: SQLite.select(SQLite.select().from(SomeTable.class).where(..)).from(SomethingElse.class).... (SELECT (SELECT * From...))
  5. Doc improvements, bug fixes and more.