-
Notifications
You must be signed in to change notification settings - Fork 600
Home
Andrew Grosner edited this page Jul 3, 2015
·
12 revisions
This section will contain changes from other releases on the xx.xx version. For example if the library is at version 2.1.5, then all versions earlier than 2.1 will be shown here.
- Library now is on jCenter()/bintray!
- Full Enum Support. Note: they must be standard columns. We do not support foreign key or primary key for enums.
- Can now define inherited properties to use as columns. Note: They can only be normal, accessible to the subclass columns for now. Just
define
@Table(inheritedColumns = {@InheritedColumn(column = @Column, fieldName = "fieldName")}
. - Bug Fixes, readme enhancements, Logging Improvements, and improved code commenting
- Function support for SQLite methods in a condition such that
date(myColumn1)=1433872730
can be written asCondition.columnsWithFunction("date", "myColumn1").eq(1433872730)
- Fixed an issue where
Condition
instead ofSQLCondition
were leftover as a param in a few methods.
- Massive, massive changes to the library.
- For all changes, check out the migration guide here
- Fixes
Cursor
synchronization bug where its used and modified in different threads, leading stale cursor to be used and subsequent crashes inFlowTableList
andFlowCursorList
- Fixes bug where foreign key reference table is not quoted
- Added validation to prevent specifying
name()
for aColumn.FOREIGN_KEY
- Added a
$ViewTable
static constant fields forModelView
so incase the view column is different from model for easy reference.
- Removes internal
ContentObserver
forFlowCursorList
. Callrefresh()
when data becomes stale. This does not break any backwards compatibility as once a single refresh was called, the observer never reregistered anyways.
- Fixes issue where an
IndexMigration
recursively called the database rather than use the method database. - Fixes issue where non-unique columns with specified
uniqueGroups
did not create the groups - Fixes issue where
Long
orInteger
primary keys caused aNullPointerException
- Added unique columns support by using
@UniqueGroup
for columns to enable multiple different groups of columns #117 - Fixes an issue where autoincrement update methods do not pass in the id of the object, possibly touching other rows unintentionally
- Added global configurable defaults for
insertConfict()
andupdateConflict()
in a@Database
for any table that does not define aConflictAction
#104 - Added
bulkInsert
support to the@ContentProvider
and corresponding method inContentUtils
#108 - Added Kotlin support! just change the
generatedClassSeparator()
for a@Database
to Kotlin compatible. #90 - Added usage guide for databases
- Adds better null loading, as in it prevents loading null values into the object when it's not null. #128
Fixes a StackOverflowError
when using BaseCacheableModel
- #106 Empty model list will cause a crash in ProcessModelInfo
- #101 Fixes issue where removeAll(Collection) crashes in certain scenarios where the list is a subclass with generic parameters. Now will explicitly fail with ClassCastException if of wrong type.
- #86 Now can force notifying content observer changes across different processes
- Adds annotation processing for creating
ContentProvider
access classes - Generates ContentProviders for you
- Decent amount of features including connecting
Model
classes to a ContentProvider so you don't need to writeContentValues
. - Based on schematic
- Adds and condenses some adapter code generation as well as adds support for methods needed for them.
- Fixes all tests so they can run successfully without clearing data.
- Added usage docs for this new major feature!
- #95 where a
JSONObject.NULL
was not recognized as a propernull
. - Added support for non-autoincrementing primary keys as model cache key. Allows for single
int
orlong
PRIMARY_KEY
field to be a caching id. - Fixes an issue where a method in
count()
for non-SELECT statements was called in pre-honeycomb devices anyways. Now it uses a raw query statement for compatibility.
- Fixes issue where using
ProcessModelInfo
with aModelContainer
caused the database table lookup to happen on theModelContainer
class and not the Model it points to. - Updated code comments and moved most
Where
parameters inTransactionManager
,TableTransactionManager
and other places whereSelectListTransaction
orSelectSingleModelTransaction
were used. Backwards compatability still applies.
- Fixes issue where
TypeConverter
crashed when null field value was passed. Now it will return null for both methods when data is null
- Adds
Index
support andIndexMigration
support!! Fixes #63 - Fixes #76
FlowCursorList
whereHandler
was not using main looper - fixes #72
FlowTableList
whereLruCache
does not allow cache size of 0, causing crash. Also now the count can be determined by overridinggetCacheSize()
- Fixes #71 where
Migration
documentation was not fully clear. - Added
Index
documentation
- now we quote columns and table creations to support SQLite Keyword named columns and table names from here thanks @mozarcik
- Can extend
BaseCacheableModel
to create an in memory cache forModel
for instant retrieval for any query to the DB if it exists in the cache. - Can create your own
ModelCache
, however this library comes withModelLruCache
andSparseArrayBasedCache
! - Can define a custom cache for
FlowTableList
andFlowCursorList
- Added README support for Model caching
- Discovered a bottleneck when we call
SqlUtils.notifyModelChanged()
even when not listening for changes. Now it only gets called when we register aFlowContentObserver
, resulting in ~%60 speed improvement for all DB modification operations!!!! - Consolidated
ModelContainerUtils
methods intoSqlUtils
due to the adapter improvements in 1.4.2 that enabled the change. ThusModelContainerUtils
is deprecated. -
SqlUtils.convertToList()
should be leaner by reusing a model adapter before looping through aCursor
.
- Simplifies internal adapter structure and have them implement common interfaces
-
Column.PRIMARY_KEY_AUTO_INCREMENT
now changes the way existence behaves: instead of using a query on the DB for the existence, it will use that field's value. If the value is 0, it's not in the DB and willsave()
. - Deleting an autoincrementing column will reset that object's id column to 0
- Fixes issue where a
@ContainerAdapter
updateAutoIncrement()
wasn't respecting the@ContainerKey
- Adds vargs to the
Condition.in()
andCondition.notIn()
methods - Fixes issue where
Insert
wrapper did not execute the correct method when calledquery()
orqueryClose()
- Throws error if the
TypeConverterDefinition
cannot process the type parameters, and warns devs of using type parameters for a typeparameter in aTypeConverter
. Thanks mariciv - Fixes
BaseDatabaseDefinition.reset()
fails to reset DB. Now appends ".db" to database name. Thanks bafitor
- Fixes issue where using
Set.query()
called the wrong query method.
- Fixes a crash within ```ModelUtils`` from the compiler` for a non-standard column
- Add validation to ensure crash does not happen from (1).
- Add
INSERT
asQueriable
interface. -
Queriable
interface was drastically simplified down to two methods.query()
andqueryClose()
. Never fearModelQueriable
is here! Same as previousQueriable
just new and more descriptive name. -
Condition.columnRaw()
will not TypeConvert or convert the value to a SQL escaped string when used. -
Condition.eq()
added that just mirrorsis()
but will sound nicer when writing some queries. -
Condition.column(columnName).concatenateToColumn(value)
will concatenate the query:columnName=columnName || 'value'
for strings, orcolumnName=columnName + value
for numbers. It will handle type converters appropriately
Legacy changelog:
- Fixes issue where
$ContainerAdapter
generated the incorrectupdateAutoIncrement()
method. - Also updated
ModelContainerUtils
to utilize the more efficient usage ofsave()
,insert()
, andupdate()
just likeModel
already do.
- Adds in
ConflictAction
you can specify for a@Table
insert and update methods. This will not work on earlier than FROYO (API 8) for update statements. - Added
InsertTransaction
andInsertModelTransaction
that handle insert queries with theTransactionManager
- Now
BaseModel
will directly callUPDATE
andINSERT
methods in theupdate()
andinsert()
instead of usingsave()
when calling those methods directly for a small performance gain. - Added checking and attempts. Thanks wongcain
- Now supports
ForeignKeyContainer
which when placed in a field of aModel
, will hold onto the foreign key cursor data and provide an on-demand lazy loading of foreign key objects by callingtoModel()
. - Added support for
LoadFromCursorListener
,SQLiteStatementListener
, andContentValuesListener
within a model to implement to perform some custom action during use of those methods. - Added a
saveForeignKeyModel()
option inColumn
to disablesave()
on a contained foreign keyModel
orModelContainer
from within its associated Adapter class. Thanks davidschreiber
- Added SQLite Triggers!
- Added the
IN
andNOT IN
operators toCondition
- Fixes an issue where a
FlowCursorList
was A. not caching models and B. not handlingModelView
properly, thanks Cain. - Added
ForeignKeyAction
which specify the action to take when updates and deletes occur to the foreign key. Thanks Michal - Added the
Insert
statement wrapper! Particularily useful forTrigger
-
ConditionQueryBuilder
no longer mapscolumnName
to aCondition
since if we wanted to doOR
operation on the same column multiple times, it would only take the last condition since it was aMap
of columnNames. - Added
Condition.Operation
constant class for operation and SQL method constants - Fixed the
IS NULL
andIS NOT NULL
conditions and wrote test to ensure working
- Fixes issue where boxed primitive values such as Long, when null, were throwing
NullPointerException
inbindToStatement()
. Added a test to prevent any future issues. -
From.as()
wasn't using type parameters in return, thus a warning would be thrown. - Added two new methods to
Queriable
:queryCursorList()
andqueryTableList()
. These corresponding methods will make constructing aFlowCursorList
orFlowTableList
from a completed query much simpler.
- Fixed issue where using non-string foreign keys caused a build error.
- Optimized loading foreign key objects from the DB by checking using the
Cursor.isNull()
method before calling a SELECT query (thanks Michal) - Made
FlowCursorList
andFlowTableList
more robust and flexible by enablingQueriable
objects to be used to generate it's internal cursor. AddedCondition...
parameter toFlowTableList
as well. - Added two new methods to
Queriable
:queryClose()
will execute a query on the DB and close theCursor
if needed.getTable()
simply returns the table that the query comes from. - Made
TransactionListenerAdapter
both the class and theonResultReceived()
method no longer abstract to make it useful in situations other than results.
- Fixed issue where
Collate
enum was not appendingCOLLATE
to the SQL query - Added the ability to chain
Condition
together using different separators. Just callseparator()
on aCondition
used in aConditionQueryBuilder
. - Added tests for
Between
and these fixes.
- Fixes an issue with Boolean converter throwing a
NullPointerException
when aModelContainer
does not contain the field. - Added null checks in the
toModel()
method of aContainerAdapter
definition class. - We
bindNull()
andputNull()
for missing foreign key fields in the ````$Adapter``` definition, previously this bug did not allow the removal of foreign key object fields. - Added a
purgeQueue()
and the ability to set the priority of the batches in theDBBatchSaveQueue
- Added the
Between
method for SQLite statements - Added a method in
Delete
for clearing multiple tables
- Added support for SQLite
COLLATE
in@Column
andCondition
classes - Added support for
DEFAULT
values in column creation. - Deprecated
ResultReceiver
to replace it withTransactionListenerAdapter
which provides a base implementation ofTransactionListener
.TransactionListener
provides more callback methods to the state of a DB transaction. As a resultResultReceiver
is no longer an interface, rather an abstract class. NOTE:BaseResultTransaction
'sTransactionListener
must return true fromhasResult(BaseResultTransaction, ResultClass)
to haveonResultReceived()
called. -
FlowCursorList
is more flexible by adding methods to clear the cache, dynamically enable/disable the cache, and set a customWhere
for the cursor to use.
Fixed an issue where TypeConverter
for boolean values would incorrectly try to cast in bindLong
to Boolean
- Added
JSONArrayModel
, which will operate on all items and backed by aJSONArray
-
@ContainerKey
enables different key from a model container@Key
field
- Fixes issue in
FlowCursorList
that caused the cursor to reset everytimegetItem(int)
was called - Fixes "DSC" to "DESC" for SQL orderby