Android Open Source - ContentProviderProcessor Contract S Q Lite Open Helper






From Project

Back to project page ContentProviderProcessor.

License

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.

Java Source Code

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 );
    }
  }

}




Java Source Code List

de.wackernagel.android.contractcontentprovider.AbstractContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.ContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.ContentProviderUtils.java
de.wackernagel.android.contractcontentprovider.ContractContentProvider.java
de.wackernagel.android.contractcontentprovider.ContractSQLiteOpenHelper.java
de.wackernagel.android.contractcontentprovider.Contract.java
de.wackernagel.android.contractcontentprovider.DefaultContentProviderProcessor.java
de.wackernagel.android.contractcontentprovider.GenericUriMatcher.java
de.wackernagel.android.contractcontentprovider.sample.MainActivity.java
de.wackernagel.android.contractcontentprovider.sample.provider.CustomerContract.java
de.wackernagel.android.contractcontentprovider.sample.provider.SampleProvider.java