@@ -0,0 +1,2331 @@
+package com.expidev.gcmapp.db;%0A%0Aimport android.content.Context;%0Aimport android.database.Cursor;%0Aimport android.database.sqlite.SQLiteDatabase;%0Aimport android.database.sqlite.SQLiteOpenHelper;%0Aimport android.util.Log;%0A%0Aimport com.expidev.gcmapp.sql.TableNames;%0Aimport com.expidev.gcmapp.utils.DatabaseOpenHelper;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Created by William.Randall on 1/21/2015.%0A */%0Apublic class MinistriesDao%0A%7B%0A    private final String TAG = getClass().getSimpleName();%0A%0A    private final SQLiteOpenHelper databaseHelper;%0A%0A    private static final Object instanceLock = new Object();%0A    private static MinistriesDao instance;%0A%0A    private MinistriesDao(final Context context)%0A    %7B%0A        this.databaseHelper = new DatabaseOpenHelper(context);%0A    %7D%0A%0A    public static MinistriesDao getInstance(Context context)%0A    %7B%0A        if(instance == null)%0A        %7B%0A            synchronized(instanceLock)%0A            %7B%0A                instance = new MinistriesDao(context.getApplicationContext());%0A            %7D%0A        %7D%0A%0A        return instance;%0A    %7D%0A%0A    public Cursor retrieveAssociatedMinistriesCursor()%0A    %7B%0A        final SQLiteDatabase database = databaseHelper.getReadableDatabase();%0A        try%0A        %7B%0A            return database.query(TableNames.ASSOCIATED_MINISTRIES.getTableName(), null, null, null, null, null, null);%0A        %7D%0A        catch(Exception e)%0A        %7B%0A            Log.e(TAG, %22Failed to retrieve associated ministries: %22 + e.getMessage());%0A        %7D%0A%0A        return null;%0A    %7D%0A%0A    public List%3CString%3E retrieveAssociatedMinistries()%0A    %7B%0A        Cursor cursor = null;%0A%0A        try%0A        %7B%0A            cursor = retrieveAssociatedMinistriesCursor();%0A%0A            if(cursor != null && cursor.getCount() %3E 0)%0A            %7B%0A                List%3CString%3E associatedMinistries = new ArrayList%3CString%3E(cursor.getCount());%0A%0A                cursor.moveToFirst();%0A                for(int i = 0; i %3C cursor.getCount(); i++)%0A                %7B%0A                    associatedMinistries.add(cursor.getString(cursor.getColumnIndex(%22name%22)));%0A                %7D%0A%0A                return associatedMinistries;%0A            %7D%0A        %7D%0A        finally%0A        %7B%0A            if(cursor != null)%0A            %7B%0A                cursor.close();%0A            %7D%0A        %7D%0A%0A        return null;%0A    %7D%0A%7D%0A

Create dao for associated ministries