All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.abubusoft.kripton.android.sqlite.SQLiteUpdateTask Maven / Gradle / Ivy

The newest version!
/*******************************************************************************
 * Copyright 2015, 2017 Francesco Benincasa ([email protected]).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package com.abubusoft.kripton.android.sqlite;

import androidx.sqlite.db.SupportSQLiteDatabase;

/**
 * 

* SQLite schema upgrade to version currentVersion from currentVersion-1. * When you create an update task, you just to specify currentVersion, because the previuos version is the same minus 1. *

* *
 *     @BindDataSourceOptions(updateTasks = {
 *   @BindDataSourceUpdateTask(version = 2, task = PersonUpdateTask.class)
 * })
 * @BindDataSource(daoSet = { DaoPerson.class }, fileName = "app.db")
 * public interface AppDataSource {
 *
 * }
 * 
* * @author Francesco Benincasa ([email protected]) * */ public interface SQLiteUpdateTask { /** * method to execute to launch build update from previous version to current version. * * @param database the database * @param previousVersion the previous version * @param targetVersion the target version */ void execute(SupportSQLiteDatabase database, int previousVersion ,int targetVersion); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy