Back to project page ContentProviderProcessor.
The source code is released under:
Apache License
If you think the Android project ContentProviderProcessor 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 de.wackernagel.android.contractcontentprovider; /*from w ww . j a v a 2 s . co m*/ import java.util.List; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDatabase.CursorFactory; import android.database.sqlite.SQLiteOpenHelper; public class ContractSQLiteOpenHelper extends SQLiteOpenHelper { private final List<Contract> contracts; public ContractSQLiteOpenHelper( Context context, String databaseName, int databaseVersion, List<Contract> contracts ) { this( context, databaseName, null, databaseVersion, contracts ); } public ContractSQLiteOpenHelper( Context context, String databaseName, CursorFactory factory, int databaseVersion, List<Contract> contracts ) { super( context, databaseName, factory, databaseVersion ); this.contracts = contracts; } @Override public void onCreate( SQLiteDatabase db ) { // each contract handled by himself the table creation for( Contract contract : contracts ) { contract.onCreateStatement( db ); } } @Override public void onUpgrade( SQLiteDatabase db, int oldVersion, int newVersion ) { // each contract handled by himself the table upgrade for( Contract contract : contracts ) { contract.onUpgradeStatement( db, oldVersion, newVersion ); } } }