package com.mick88.dittimetable;

import android.content.Context;

import com.michaldabski.msqlite.MSQLiteOpenHelper;
import com.mick88.dittimetable.timetable.Timetable;

public class DatabaseHelper extends MSQLiteOpenHelper
{
	private static final String name = "timetables.db";
	private static final int version = 1;
	
	public DatabaseHelper(Context context, Class<?>[] trackedClasses) {
		super(context, name, null, version, new Class<?>[]{
				Timetable.class,
		});
	}
	
}

@@ -27,16 +27,40 @@
 table;%0A%0A
+import java.util.List;%0A%0A
 import a
@@ -83,16 +83,16 @@
 ontext;%0A
-
 %0Aimport 
@@ -380,35 +380,8 @@
 text
-, Class%3C?%3E%5B%5D trackedClasses
 ) %7B%0A
@@ -464,12 +464,402 @@
 %09%7D);%0A%09%7D%0A
-
 %09%0A
+%09public Timetable getTimetable(String course, int year, String weeks)%0A%09%7B%0A%09%09List%3CTimetable%3E timetables = select(Timetable.class, %22course=? AND year=? and weekRange=?%22, %0A%09%09%09%09new String%5B%5D%7Bcourse, String.valueOf(year), weeks%7D, %0A%09%09%09%09null, %221%22);%0A%09%09if (timetables.isEmpty()) return null;%0A%09%09return timetables.get(0);%0A%09%7D%0A%09%0A%09public void saveTimetable(Timetable timetable)%0A%09%7B%0A%09%09replace(timetable);%0A%09%7D%0A
 %7D%0A

Add methods to save and load timetable