|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vodafone360.people.database.tables.ContactGroupsTable
public abstract class ContactGroupsTable
Contains all the functionality related to the contact groups database table. This table stores all contact/group associations (0-many to 0-many relationship). This class is never instantiated hence all methods must be static.
| Nested Class Summary | |
|---|---|
private static class |
ContactGroupsTable.ContactGroup
Represents the data stored in a record |
static class |
ContactGroupsTable.Field
An enumeration of all the field names in the database. |
| Field Summary | |
|---|---|
protected static java.lang.String |
TABLE_NAME
Name of the table as it appears in the database |
| Constructor Summary | |
|---|---|
ContactGroupsTable()
|
|
| Method Summary | |
|---|---|
static boolean |
addContactToGroup(long localContactId,
long zybGroupId,
SQLiteDatabase writableDb)
Associates a contact and a group |
static void |
create(SQLiteDatabase writeableDb)
Create Contact Groups Table. |
static boolean |
deleteContact(long localContactId,
SQLiteDatabase writableDb)
Removes all references to a contact from the table (should be called when a contact is deleted). |
static boolean |
deleteContactFromGroup(long localContactId,
long zybGroupId,
SQLiteDatabase writableDb)
Remove the association between contact and group. |
static boolean |
fetchContactGroups(long localContactId,
java.util.List<java.lang.Long> groupIds,
SQLiteDatabase readableDb)
Fetches all the groups associated with a given contact. |
private static ContentValues |
fillUpdateData(ContactGroupsTable.ContactGroup contactGroup)
Returns a ContentValues object that can be used to insert or update a new contact/group association to the table. |
static ServiceStatus |
modifyContact(Contact contact,
SQLiteDatabase db)
Merges the given contact group relation changes into the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String TABLE_NAME
| Constructor Detail |
|---|
public ContactGroupsTable()
| Method Detail |
|---|
public static void create(SQLiteDatabase writeableDb)
throws SQLException
writeableDb - A writable SQLite database
SQLException - If an SQL compilation error occursprivate static ContentValues fillUpdateData(ContactGroupsTable.ContactGroup contactGroup)
contactGroup - A ContactGroup object with the local Contact ID and
Group Id set appropriately.
public static boolean addContactToGroup(long localContactId,
long zybGroupId,
SQLiteDatabase writableDb)
localContactId - The local contact Id from the Contacts tablezybGroupId - The server group ID from groups tablewriteableDb - A writable SQLite database
public static boolean deleteContactFromGroup(long localContactId,
long zybGroupId,
SQLiteDatabase writableDb)
localContactId - The local contact Id from the Contacts tablezybGroupId - The server group ID from groups tablewriteableDb - A writable SQLite database
public static boolean deleteContact(long localContactId,
SQLiteDatabase writableDb)
localContactId - The local contact Id from the Contacts tablewriteableDb - A writable SQLite database
public static boolean fetchContactGroups(long localContactId,
java.util.List<java.lang.Long> groupIds,
SQLiteDatabase readableDb)
localContactId - The local contact Id from the Contacts tablegroupIds - A list that will be populated with the result.readableDb - A readable SQLite database
public static ServiceStatus modifyContact(Contact contact,
SQLiteDatabase db)
contact - the updated contact with the new group relations. If any
of the group IDs are -1 the associated will be ignored.writeableDb - A writable SQLite database
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
JavaDoc