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);
}
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() });
}
}
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);
}
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() });
}
}
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;
}
Aggregations