-
Notifications
You must be signed in to change notification settings - Fork 596
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)=1433872730can be written asCondition.columnsWithFunction("date", "myColumn1").eq(1433872730) - Fixed an issue where
Conditioninstead ofSQLConditionwere leftover as a param in a few methods.
- Massive, massive changes to the library.
- For all changes, check out the migration guide here
- Fixes
Cursorsynchronization bug where its used and modified in different threads, leading stale cursor to be used and subsequent crashes inFlowTableListandFlowCursorList
- Fixes bug where foreign key reference table is not quoted
- Added validation to prevent specifying
name()for aColumn.FOREIGN_KEY - Added a
$ViewTablestatic constant fields forModelViewso incase the view column is different from model for easy reference.
- Removes internal
ContentObserverforFlowCursorList. 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
IndexMigrationrecursively called the database rather than use the method database. - Fixes issue where non-unique columns with specified
uniqueGroupsdid not create the groups - Fixes issue where
LongorIntegerprimary keys caused aNullPointerException
- Added unique columns support by using
@UniqueGroupfor 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@Databasefor any table that does not define aConflictAction#104 - Added
bulkInsertsupport to the@ContentProviderand corresponding method inContentUtils#108 - Added Kotlin support! just change the
generatedClassSeparator()for a@Databaseto 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
ContentProvideraccess classes - Generates ContentProviders for you
- Decent amount of features including connecting
Modelclasses 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.NULLwas not recognized as a propernull. - Added support for non-autoincrementing primary keys as model cache key. Allows for single
intorlongPRIMARY_KEYfield 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
ProcessModelInfowith aModelContainercaused the database table lookup to happen on theModelContainerclass and not the Model it points to. - Updated code comments and moved most
Whereparameters inTransactionManager,TableTransactionManagerand other places whereSelectListTransactionorSelectSingleModelTransactionwere used. Backwards compatability still applies.
- Fixes issue where
TypeConvertercrashed when null field value was passed. Now it will return null for both methods when data is null
- Adds
Indexsupport andIndexMigrationsupport!! Fixes #63 - Fixes #76
FlowCursorListwhereHandlerwas not using main looper - fixes #72
FlowTableListwhereLruCachedoes not allow cache size of 0, causing crash. Also now the count can be determined by overridinggetCacheSize() - Fixes #71 where
Migrationdocumentation was not fully clear. - Added
Indexdocumentation
- now we quote columns and table creations to support SQLite Keyword named columns and table names from here thanks @mozarcik
- Can extend
BaseCacheableModelto create an in memory cache forModelfor instant retrieval for any query to the DB if it exists in the cache. - Can create your own
ModelCache, however this library comes withModelLruCacheandSparseArrayBasedCache! - Can define a custom cache for
FlowTableListandFlowCursorList - 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
ModelContainerUtilsmethods intoSqlUtilsdue to the adapter improvements in 1.4.2 that enabled the change. ThusModelContainerUtilsis 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_INCREMENTnow 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
@ContainerAdapterupdateAutoIncrement()wasn't respecting the@ContainerKey
- Adds vargs to the
Condition.in()andCondition.notIn()methods - Fixes issue where
Insertwrapper did not execute the correct method when calledquery()orqueryClose()
- Throws error if the
TypeConverterDefinitioncannot 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
INSERTasQueriableinterface. -
Queriableinterface was drastically simplified down to two methods.query()andqueryClose(). Never fearModelQueriableis here! Same as previousQueriablejust 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 + valuefor numbers. It will handle type converters appropriately
Legacy changelog:
- Fixes issue where
$ContainerAdaptergenerated the incorrectupdateAutoIncrement()method. - Also updated
ModelContainerUtilsto utilize the more efficient usage ofsave(),insert(), andupdate()just likeModelalready do.
- Adds in
ConflictActionyou can specify for a@Tableinsert and update methods. This will not work on earlier than FROYO (API 8) for update statements. - Added
InsertTransactionandInsertModelTransactionthat handle insert queries with theTransactionManager - Now
BaseModelwill directly callUPDATEandINSERTmethods in theupdate()andinsert()instead of usingsave()when calling those methods directly for a small performance gain. - Added checking and attempts. Thanks wongcain
- Now supports
ForeignKeyContainerwhich 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, andContentValuesListenerwithin a model to implement to perform some custom action during use of those methods. - Added a
saveForeignKeyModel()option inColumnto disablesave()on a contained foreign keyModelorModelContainerfrom within its associated Adapter class. Thanks davidschreiber
- Added SQLite Triggers!
- Added the
INandNOT INoperators toCondition - Fixes an issue where a
FlowCursorListwas A. not caching models and B. not handlingModelViewproperly, thanks Cain. - Added
ForeignKeyActionwhich specify the action to take when updates and deletes occur to the foreign key. Thanks Michal - Added the
Insertstatement wrapper! Particularily useful forTrigger
-
ConditionQueryBuilderno longer mapscolumnNameto aConditionsince if we wanted to doORoperation on the same column multiple times, it would only take the last condition since it was aMapof columnNames. - Added
Condition.Operationconstant class for operation and SQL method constants - Fixed the
IS NULLandIS NOT NULLconditions and wrote test to ensure working
- Fixes issue where boxed primitive values such as Long, when null, were throwing
NullPointerExceptioninbindToStatement(). 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 aFlowCursorListorFlowTableListfrom 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
FlowCursorListandFlowTableListmore robust and flexible by enablingQueriableobjects to be used to generate it's internal cursor. AddedCondition...parameter toFlowTableListas well. - Added two new methods to
Queriable:queryClose()will execute a query on the DB and close theCursorif needed.getTable()simply returns the table that the query comes from. - Made
TransactionListenerAdapterboth the class and theonResultReceived()method no longer abstract to make it useful in situations other than results.
- Fixed issue where
Collateenum was not appendingCOLLATEto the SQL query - Added the ability to chain
Conditiontogether using different separators. Just callseparator()on aConditionused in aConditionQueryBuilder. - Added tests for
Betweenand these fixes.
- Fixes an issue with Boolean converter throwing a
NullPointerExceptionwhen aModelContainerdoes not contain the field. - Added null checks in the
toModel()method of aContainerAdapterdefinition 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
Betweenmethod for SQLite statements - Added a method in
Deletefor clearing multiple tables
- Added support for SQLite
COLLATEin@ColumnandConditionclasses - Added support for
DEFAULTvalues in column creation. - Deprecated
ResultReceiverto replace it withTransactionListenerAdapterwhich provides a base implementation ofTransactionListener.TransactionListenerprovides more callback methods to the state of a DB transaction. As a resultResultReceiveris no longer an interface, rather an abstract class. NOTE:BaseResultTransaction'sTransactionListenermust return true fromhasResult(BaseResultTransaction, ResultClass)to haveonResultReceived()called. -
FlowCursorListis more flexible by adding methods to clear the cache, dynamically enable/disable the cache, and set a customWherefor 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 -
@ContainerKeyenables different key from a model container@Keyfield
- Fixes issue in
FlowCursorListthat caused the cursor to reset everytimegetItem(int)was called - Fixes "DSC" to "DESC" for SQL orderby