Back to project page androidata.
The source code is released under:
Apache License
If you think the Android project androidata listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.stanidesis.androidata.table; /* w ww . j a v a 2s . co m*/ import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.stanidesis.androidata.AndroiDataUpgradeHelper; import com.stanidesis.androidata.column.Column; import com.stanidesis.androidata.column.RowIDColumn; import com.stanidesis.androidata.model.IModelBuilder; import com.stanidesis.androidata.model.IModelUpdateBuilder; /** * Created by Stanley Idesis on 8/15/14. */ public interface ITable { /** * @return the string name of this table. * Must be SQLite compliant. */ public String getName(); /** * @return the AndroiData version number during * which this table was introduced */ public int versionIntroduced(); /** * @return an array of all the Columns this table requires */ public Column[] getColumns(); /** * @return a reference to a RowID column representing * this table's Row ID */ public RowIDColumn getRowIDColumn(); /** * * @param upgradeHelper * @param oldVersion * @param newVersion */ public void onUpgrade(AndroiDataUpgradeHelper upgradeHelper, int oldVersion, int newVersion); /** * @param readOnlyDB * @param rowId * @return a cursor with the contents of the entry associated with the given rowId */ public Cursor getRow(SQLiteDatabase readOnlyDB, long rowId); /** * @param readOnlyDB * @return every entry in the database */ public Cursor selectAll(SQLiteDatabase readOnlyDB); /** * @param readOnlyDB * @param ignoreIds * @return every entry in the database excluding the given IDs */ public Cursor selectAll(SQLiteDatabase readOnlyDB, long[] ignoreIds); /** * @param readOnlyDB * @return the number of entries in the table */ public Integer count(SQLiteDatabase readOnlyDB); /** * @deprecated use {@link #insert(android.database.sqlite.SQLiteDatabase, android.content.ContentValues)}, * * Insert a new instance of a row based on the model builder. * * @param writableDB * @param builder * @return */ public long insert(SQLiteDatabase writableDB, IModelBuilder builder); /** * Insert a new row using the given ContentValues. * * @since v1.0.5 * @param writableDB * @param values * @return */ public long insert(SQLiteDatabase writableDB, ContentValues values); /** * Delete each row corresponding to each entry in the array. * * @since v1.0.5 * @param writableDB * @param idsToDelete */ public void delete(SQLiteDatabase writableDB, long [] idsToDelete); /** * @deprecated use {@link #update(android.database.sqlite.SQLiteDatabase, android.content.ContentValues, long)} * Update the row represented by an IModelUpdateBuilder * @param writableDB * @param builder * @return */ public boolean update(SQLiteDatabase writableDB, IModelUpdateBuilder builder); /** * Update a specific row with the given ContentValues * * @since v1.0.5 * @param writableDB * @param values * @param rowId */ public void update(SQLiteDatabase writableDB, ContentValues values, long rowId); /** * Update all rows whose IDs are provided with the given ContentValues * * @since v1.0.5 * @param writableDB * @param values * @param idsToUpdate */ public void update(SQLiteDatabase writableDB, ContentValues values, long [] idsToUpdate); /** * Update every entry in the table * @param writableDB * @param values */ public void update(SQLiteDatabase writableDB, ContentValues values); /** * Search through the table for rows where the columns match the provided * object arguments. * * @param readOnlyDB * @param columns * @param equalTo * @param limit * @return */ public Cursor find(SQLiteDatabase readOnlyDB, Column [] columns, Object [] equalTo, int limit); }