// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/AlbumsTable.java
// public class AlbumsTable implements ITable {
// 
// 	private AlbumsTable() {}
// 
// 	/*
// 	 * Column names
// 	 */
// 	public static final String ALBUM_ID = "album_id";
// 
// 	public static final String THUMBNAIL_URL = "thumbnail_url";
// 	
// 	public static final String ETAG = "etag";
// 	
// 	public static final String TITLE = "title";
// 	
// 	public static final String UPDATED = "updated";
// 	
// 	public static final String THUMBNAIL_LOCAL_PATH = "thumbnail_local_path";
// 
// 	/*
// 	 * ITable interface methods
// 	 */
// 	
// 	private static AlbumsTable mInstance;
// 	
// 	public static ITable getInstance() {
// 		if(null == mInstance) {
// 			mInstance = new AlbumsTable();
// 		}
// 		
// 		return mInstance;
// 	}
// 	
// 	public String getTableName() {
// 		return "albums";
// 	}
// 	
// 	public String getCreateTableSQL() {
// 		String sql = "CREATE TABLE " + getTableName() + " ("
// 			+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
// 			+ ALBUM_ID + " TEXT,"
// 			+ ETAG + " TEXT,"
// 			+ TITLE + " TEXT,"
// 			+ UPDATED + " TEXT,"
// 			+ THUMBNAIL_LOCAL_PATH + " TEXT"
// 			+ ");";
// 		
// 		return sql;
// 	}
// 	
// 	private static HashMap<String, String> mProjectionMap;
// 	public HashMap<String, String> getProjectionMap() {
// 		return mProjectionMap;
// 	}
// 
// 	static {
// 		mProjectionMap = new HashMap<String, String>();
// 		mProjectionMap.put(_ID, _ID);
// 		mProjectionMap.put(ALBUM_ID, ALBUM_ID);
// 		mProjectionMap.put(ETAG, ETAG);
// 		mProjectionMap.put(TITLE, TITLE);
// 		mProjectionMap.put(UPDATED, UPDATED);
// 		mProjectionMap.put(THUMBNAIL_LOCAL_PATH, THUMBNAIL_LOCAL_PATH);
// 	}
// }
// 
// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/ITable.java
// public interface ITable extends BaseColumns {
// 
// 	String getTableName();
// 
// 	String getCreateTableSQL();
// 	
// 	HashMap<String, String> getProjectionMap();
// }
// 
// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/PhotosTable.java
// public class PhotosTable implements ITable {
// 
// 	private PhotosTable() {}
// 
// 	/*
// 	 * Column names
// 	 */
// 	public static final String PHOTO_ID = "photo_id";
// 	
// 	public static final String THUMBNAIL_URL = "thumbnail_url";
// 	
// 	public static final String ETAG = "etag";
// 	
// 	public static final String THUMBNAIL_LOCAL_PATH = "thumbnail_local_path";
// 	
// 	public static final String PHOTO_URL = "photo_url";
// 	
// 	public static final String ALBUM_ID = "album_id";
// 	
// 	/*
// 	 * ITable interface members 
// 	 */
// 	
// 	private static PhotosTable mInstance;
// 	
// 	public static ITable getInstance() {
// 		if(null == mInstance) {
// 			mInstance = new PhotosTable();
// 		}
// 		
// 		return mInstance;
// 	}
// 	
// 	public String getCreateTableSQL() {
// 		String sql = "CREATE TABLE " + getTableName() + " ("
// 			+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
// 			+ PHOTO_ID + " TEXT,"
// 			+ ETAG + " TEXT,"
// 			+ THUMBNAIL_LOCAL_PATH + " TEXT,"
// 			+ PHOTO_URL + " TEXT,"
// 			+ ALBUM_ID + " TEXT"
// 			+ ");";
// 	
// 		return sql;
// 	}
// 
// 	public String getTableName() {
// 		return "photos";
// 	}
// 	
// 	private static HashMap<String, String> mProjectionMap;
// 	public HashMap<String, String> getProjectionMap() {
// 		return mProjectionMap;
// 	}
// 
// 	static {
// 		mProjectionMap = new HashMap<String, String>();
// 		mProjectionMap.put(_ID, _ID);
// 		mProjectionMap.put(PHOTO_ID, PHOTO_ID);
// 		mProjectionMap.put(ETAG, ETAG);
// 		mProjectionMap.put(PHOTO_URL, PHOTO_URL);
// 		mProjectionMap.put(THUMBNAIL_LOCAL_PATH, THUMBNAIL_LOCAL_PATH);
// 		mProjectionMap.put(ALBUM_ID, ALBUM_ID);
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import com.guaranacode.android.fastpicasabrowser.database.tables.AlbumsTable;
import com.guaranacode.android.fastpicasabrowser.database.tables.ITable;
import com.guaranacode.android.fastpicasabrowser.database.tables.PhotosTable;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
package com.guaranacode.android.fastpicasabrowser.database;




/**
 * Helper for the databased used by the application.
 *
 * @author abe@guaranacode.com
 *
 */
public class DatabaseHelper extends SQLiteOpenHelper {

	private List<ITable> mAllTables;
	
	public DatabaseHelper(Context context) {
		super(context, DbConstants.DATABASE_NAME, null, DbConstants.DATABASE_VERSION);
		
		mAllTables = new ArrayList<ITable>();
		//JAVASUCKS: no collection initializers.
		mAllTables.add(AlbumsTable.getInstance());
// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/AlbumsTable.java
// public class AlbumsTable implements ITable {
// 
// 	private AlbumsTable() {}
// 
// 	/*
// 	 * Column names
// 	 */
// 	public static final String ALBUM_ID = "album_id";
// 
// 	public static final String THUMBNAIL_URL = "thumbnail_url";
// 	
// 	public static final String ETAG = "etag";
// 	
// 	public static final String TITLE = "title";
// 	
// 	public static final String UPDATED = "updated";
// 	
// 	public static final String THUMBNAIL_LOCAL_PATH = "thumbnail_local_path";
// 
// 	/*
// 	 * ITable interface methods
// 	 */
// 	
// 	private static AlbumsTable mInstance;
// 	
// 	public static ITable getInstance() {
// 		if(null == mInstance) {
// 			mInstance = new AlbumsTable();
// 		}
// 		
// 		return mInstance;
// 	}
// 	
// 	public String getTableName() {
// 		return "albums";
// 	}
// 	
// 	public String getCreateTableSQL() {
// 		String sql = "CREATE TABLE " + getTableName() + " ("
// 			+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
// 			+ ALBUM_ID + " TEXT,"
// 			+ ETAG + " TEXT,"
// 			+ TITLE + " TEXT,"
// 			+ UPDATED + " TEXT,"
// 			+ THUMBNAIL_LOCAL_PATH + " TEXT"
// 			+ ");";
// 		
// 		return sql;
// 	}
// 	
// 	private static HashMap<String, String> mProjectionMap;
// 	public HashMap<String, String> getProjectionMap() {
// 		return mProjectionMap;
// 	}
// 
// 	static {
// 		mProjectionMap = new HashMap<String, String>();
// 		mProjectionMap.put(_ID, _ID);
// 		mProjectionMap.put(ALBUM_ID, ALBUM_ID);
// 		mProjectionMap.put(ETAG, ETAG);
// 		mProjectionMap.put(TITLE, TITLE);
// 		mProjectionMap.put(UPDATED, UPDATED);
// 		mProjectionMap.put(THUMBNAIL_LOCAL_PATH, THUMBNAIL_LOCAL_PATH);
// 	}
// }
// 
// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/ITable.java
// public interface ITable extends BaseColumns {
// 
// 	String getTableName();
// 
// 	String getCreateTableSQL();
// 	
// 	HashMap<String, String> getProjectionMap();
// }
// 
// Path: src/com/guaranacode/android/fastpicasabrowser/database/tables/PhotosTable.java
// public class PhotosTable implements ITable {
// 
// 	private PhotosTable() {}
// 
// 	/*
// 	 * Column names
// 	 */
// 	public static final String PHOTO_ID = "photo_id";
// 	
// 	public static final String THUMBNAIL_URL = "thumbnail_url";
// 	
// 	public static final String ETAG = "etag";
// 	
// 	public static final String THUMBNAIL_LOCAL_PATH = "thumbnail_local_path";
// 	
// 	public static final String PHOTO_URL = "photo_url";
// 	
// 	public static final String ALBUM_ID = "album_id";
// 	
// 	/*
// 	 * ITable interface members 
// 	 */
// 	
// 	private static PhotosTable mInstance;
// 	
// 	public static ITable getInstance() {
// 		if(null == mInstance) {
// 			mInstance = new PhotosTable();
// 		}
// 		
// 		return mInstance;
// 	}
// 	
// 	public String getCreateTableSQL() {
// 		String sql = "CREATE TABLE " + getTableName() + " ("
// 			+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
// 			+ PHOTO_ID + " TEXT,"
// 			+ ETAG + " TEXT,"
// 			+ THUMBNAIL_LOCAL_PATH + " TEXT,"
// 			+ PHOTO_URL + " TEXT,"
// 			+ ALBUM_ID + " TEXT"
// 			+ ");";
// 	
// 		return sql;
// 	}
// 
// 	public String getTableName() {
// 		return "photos";
// 	}
// 	
// 	private static HashMap<String, String> mProjectionMap;
// 	public HashMap<String, String> getProjectionMap() {
// 		return mProjectionMap;
// 	}
// 
// 	static {
// 		mProjectionMap = new HashMap<String, String>();
// 		mProjectionMap.put(_ID, _ID);
// 		mProjectionMap.put(PHOTO_ID, PHOTO_ID);
// 		mProjectionMap.put(ETAG, ETAG);
// 		mProjectionMap.put(PHOTO_URL, PHOTO_URL);
// 		mProjectionMap.put(THUMBNAIL_LOCAL_PATH, THUMBNAIL_LOCAL_PATH);
// 		mProjectionMap.put(ALBUM_ID, ALBUM_ID);
// 	}
// 
// }


// Path: src/com/guaranacode/android/fastpicasabrowser/database/DatabaseHelper.java
import java.util.ArrayList;
import java.util.List;
import com.guaranacode.android.fastpicasabrowser.database.tables.AlbumsTable;
import com.guaranacode.android.fastpicasabrowser.database.tables.ITable;
import com.guaranacode.android.fastpicasabrowser.database.tables.PhotosTable;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

package com.guaranacode.android.fastpicasabrowser.database;




/**
 * Helper for the databased used by the application.
 *
 * @author abe@guaranacode.com
 *
 */
public class DatabaseHelper extends SQLiteOpenHelper {

	private List<ITable> mAllTables;
	
	public DatabaseHelper(Context context) {
		super(context, DbConstants.DATABASE_NAME, null, DbConstants.DATABASE_VERSION);
		
		mAllTables = new ArrayList<ITable>();
		//JAVASUCKS: no collection initializers.
		mAllTables.add(AlbumsTable.getInstance());
		mAllTables.add(PhotosTable.getInstance());