Copyright (c) 2012 Johan Brook, Robin Andersson, Lisa Stenberg, Mattias Henriksson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen...
If you think the Android project watchme listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* MovieTable.java//www.java2s.com
*
* The table in the database that holds data for Movies.
*
* @author lisastenberg
* @copyright (c) 2012 Johan Brook, Robin Andersson, Lisa Stenberg, Mattias Henriksson
* @license MIT
*/package se.chalmers.watchme.database;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
publicclass MoviesTable {
publicstaticfinal String TABLE_MOVIES = "movies";
publicstaticfinal String COLUMN_MOVIE_ID = "_id";
publicstaticfinal String COLUMN_TITLE = "title";
publicstaticfinal String COLUMN_RATING = "rating";
publicstaticfinal String COLUMN_NOTE = "note";
publicstaticfinal String COLUMN_DATE = "releasedate";
publicstaticfinal String COLUMN_IMDB_ID = "imdbid";
publicstaticfinal String COLUMN_POSTER_LARGE = "poster_url_large";
publicstaticfinal String COLUMN_POSTER_SMALL = "poster_url_small";
privatestaticfinal String CREATE_MOVIES_TABLE = "CREATE TABLE "
+ TABLE_MOVIES + "(" + COLUMN_MOVIE_ID + " INTEGER PRIMARY KEY,"
+ COLUMN_TITLE + " TEXT," + COLUMN_RATING + " INTEGER,"
+ COLUMN_NOTE + " TEXT," + COLUMN_DATE + " INTEGER,"
+ COLUMN_IMDB_ID + " TEXT," + COLUMN_POSTER_LARGE + " TEXT,"
+ COLUMN_POSTER_SMALL + " TEXT)";
publicstaticvoid onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_MOVIES_TABLE);
}
publicstaticvoid onUpgrade(SQLiteDatabase db, int oldVersion,
int newVersion) {
Log.w(MoviesTable.class.getName(), "Upgrading database from version "
+ oldVersion + " to " + newVersion
+ ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_MOVIES);
onCreate(db);
}
}