Search in sources :

Example 21 with SQLiteDatabase

use of android.database.sqlite.SQLiteDatabase in project UltimateAndroid by cymcsg.

the class TeamDAO method deleteAll.

public void deleteAll() {
    Logger.d("Deleting all teams");
    SQLiteDatabase db = getWritableDatabase();
    db.delete(TEAMS_TABLE_NAME, null, null);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 22 with SQLiteDatabase

use of android.database.sqlite.SQLiteDatabase in project UltimateAndroid by cymcsg.

the class TeamDAO method delete.

public void delete(Team team) {
    Logger.d("Deleting team with the name of '" + team.getName() + "'");
    if (team.getId() != null) {
        SQLiteDatabase db = getWritableDatabase();
        db.delete(TEAMS_TABLE_NAME, _ID + " = ?", new String[] { team.getId().toString() });
    }
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 23 with SQLiteDatabase

use of android.database.sqlite.SQLiteDatabase in project UltimateAndroid by cymcsg.

the class MeetingDAO method deleteAll.

public void deleteAll() {
    Logger.d("Deleting all meetings");
    SQLiteDatabase db = getWritableDatabase();
    db.delete(MEETINGS_TABLE_NAME, null, null);
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 24 with SQLiteDatabase

use of android.database.sqlite.SQLiteDatabase in project UltimateAndroid by cymcsg.

the class MeetingDAO method delete.

public void delete(Meeting meeting) {
    Logger.d("Deleting meeting for " + meeting.getTeam().getName() + " with a date/time of '" + meeting.getDateTime() + "'");
    if (meeting.getId() != null) {
        SQLiteDatabase db = getWritableDatabase();
        db.delete(MEETINGS_TABLE_NAME, _ID + " = ?", new String[] { meeting.getId().toString() });
    }
}
Also used : SQLiteDatabase(android.database.sqlite.SQLiteDatabase)

Example 25 with SQLiteDatabase

use of android.database.sqlite.SQLiteDatabase in project UltimateAndroid by cymcsg.

the class MeetingDAO method findByTeamAndDate.

public Meeting findByTeamAndDate(Team team, Date date) {
    Cursor cursor = null;
    Meeting meeting = null;
    try {
        long startTime = date.getTime();
        Date endDate = new Date(date.getTime());
        endDate.setSeconds(endDate.getSeconds() + 1);
        long endTime = endDate.getTime();
        SQLiteDatabase db = getReadableDatabase();
        cursor = db.query(MEETINGS_TABLE_NAME, MEETINGS_ALL_COLUMS, MEETINGS_TEAM_NAME + " = ? and " + MEETINGS_MEETING_TIME + " >= ? and " + MEETINGS_MEETING_TIME + " < ?", new String[] { team.getName(), Long.toString(startTime), Long.toString(endTime) }, null, null, null);
        if (cursor.getCount() == 1) {
            if (cursor.moveToFirst()) {
                meeting = createMeetingFromCursorData(cursor);
            }
        }
    } finally {
        closeCursor(cursor);
    }
    return meeting;
}
Also used : Meeting(com.marshalchen.common.usefulModule.standuptimer.model.Meeting) SQLiteDatabase(android.database.sqlite.SQLiteDatabase) Cursor(android.database.Cursor) Date(java.util.Date)

Aggregations

SQLiteDatabase (android.database.sqlite.SQLiteDatabase)1553 Cursor (android.database.Cursor)499 ContentValues (android.content.ContentValues)321 ArrayList (java.util.ArrayList)105 File (java.io.File)65 Test (org.junit.Test)57 SQLiteException (android.database.sqlite.SQLiteException)45 SQLiteQueryBuilder (android.database.sqlite.SQLiteQueryBuilder)44 Uri (android.net.Uri)44 ServiceStatus (com.vodafone360.people.service.ServiceStatus)42 IOException (java.io.IOException)41 SQLException (android.database.SQLException)36 SQLiteOpenHelper (android.database.sqlite.SQLiteOpenHelper)36 RemoteException (android.os.RemoteException)36 Pair (android.util.Pair)31 MediumTest (android.test.suitebuilder.annotation.MediumTest)30 Account (android.accounts.Account)29 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)25 ContactDetail (com.vodafone360.people.datatypes.ContactDetail)22 HashMap (java.util.HashMap)21