|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vodafone360.people.database.tables.GroupsTable
public abstract class GroupsTable
Contains all the functionality related to the Groups database table. The groups table stores the information about each group from the server. This class is never instantiated hence all methods must be static.
Nested Class Summary | |
---|---|
static class |
GroupsTable.Field
An enumeration of all the field names in the database. |
Field Summary | |
---|---|
private static int |
COLOR
|
static long |
GROUP_ALL
Special ID for the ALL group |
protected static long |
GROUP_CONNECTED_FRIENDS
Special ID for the connected friends group |
protected static long |
GROUP_ONLINE
Special ID for the ONLINE contacts group (to be added later) |
protected static long |
GROUP_PHONEBOOK
Special ID for the phonebook contacts group |
private static int |
GROUPTYPE
|
private static int |
IMAGEBYTES
|
private static int |
IMAGEMIMETYPE
|
private static int |
ISREADONLY
|
private static int |
ISSMARTGROUP
|
private static int |
ISSYSTEMGROUP
|
private static int |
LOCALGROUPID
Column indices which match the query string returned by getFullQueryList() . |
private static int |
NAME
|
private static int |
REQUIRESLOCALISATION
|
private static int |
SERVERGROUPID
|
private static java.lang.String |
TABLE_NAME
The name of the table as it appears in the database. |
private static int |
USERID
|
Constructor Summary | |
---|---|
GroupsTable()
|
Method Summary | |
---|---|
static ServiceStatus |
addGroupList(java.util.List<GroupItem> groupList,
SQLiteDatabase writableDb)
Adds list of groups to the table |
static void |
create(Context context,
SQLiteDatabase writableDb)
Creates Groups Table and populate it with system groups. |
static ServiceStatus |
deleteAllGroups(SQLiteDatabase writableDb)
Removes all groups from the table. |
static ServiceStatus |
fetchGroupList(java.util.ArrayList<GroupItem> groupList,
SQLiteDatabase readableDb)
Fetches a list of all the available groups. |
private static ContentValues |
fillUpdateData(GroupItem group)
Returns a ContentValues object that can be used to insert or modify a group in the table. |
private static java.lang.String |
getFullQueryList()
Fetches the list of table fields that can be injected into an SQL query statement. |
static Cursor |
getGroupCursor(SQLiteDatabase readableDb)
Fetches a cursor that can be used for browsing the groups. |
static GroupItem |
getQueryData(Cursor c)
Fetches the group data from the current record of the given cursor. |
private static java.lang.String |
getQueryStringSql(java.lang.String whereClause)
Returns a full SQL query statement to fetch a set of groups from the table. |
static ServiceStatus |
populateSystemGroups(Context context,
SQLiteDatabase writableDb)
Populates the table if system groups that are specified in the resources. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String TABLE_NAME
public static final long GROUP_ALL
protected static final long GROUP_ONLINE
protected static final long GROUP_PHONEBOOK
protected static final long GROUP_CONNECTED_FRIENDS
private static final int LOCALGROUPID
getFullQueryList()
.
private static final int SERVERGROUPID
private static final int GROUPTYPE
private static final int ISREADONLY
private static final int REQUIRESLOCALISATION
private static final int ISSYSTEMGROUP
private static final int ISSMARTGROUP
private static final int USERID
private static final int NAME
private static final int IMAGEMIMETYPE
private static final int IMAGEBYTES
private static final int COLOR
Constructor Detail |
---|
public GroupsTable()
Method Detail |
---|
public static void create(Context context, SQLiteDatabase writableDb) throws SQLException
context
- A context for reading strings from the resourceswriteableDb
- A writable SQLite database
SQLException
- If an SQL compilation error occursprivate static java.lang.String getFullQueryList()
getQueryData(Cursor)
method can be used to obtain
the data from the query.
getQueryData(Cursor).
private static java.lang.String getQueryStringSql(java.lang.String whereClause)
getQueryData(Cursor)
method can be used to obtain the
data from the query.
whereClause
- An SQL where clause (without the "WHERE"). Cannot be
null.
getQueryData(Cursor).
public static GroupItem getQueryData(Cursor c)
c
- Cursor returned by one of the getFullQueryList()
based
query methods.
private static ContentValues fillUpdateData(GroupItem group)
group
- The source GroupItem object
public static ServiceStatus fetchGroupList(java.util.ArrayList<GroupItem> groupList, SQLiteDatabase readableDb)
groupList
- A list that will be populated with the result.readableDb
- Readable SQLite database
public static ServiceStatus addGroupList(java.util.List<GroupItem> groupList, SQLiteDatabase writableDb)
groupList
- The list to addwritableDb
- Writable SQLite database
public static ServiceStatus deleteAllGroups(SQLiteDatabase writableDb)
populateSystemGroups(Context, SQLiteDatabase)
function should be
called afterwards to ensure the system groups are restored.
writableDb
- Writable SQLite database
public static Cursor getGroupCursor(SQLiteDatabase readableDb)
getQueryData(Cursor)
method can be used to fetch the data of a
particular record in the cursor.
readableDb
- Readable SQLite database
public static ServiceStatus populateSystemGroups(Context context, SQLiteDatabase writableDb)
context
- The context for reading the app resourceswritableDb
- Writable SQLite database for updating the table
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaDoc