-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Eilers Smith
committed
Jan 25, 2014
1 parent
5f3b176
commit f515a50
Showing
14 changed files
with
234 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public class Provider extends ContentProvider { | ||
private static final String TAG = "com.sobremesa.waywt.contentprovider.Provider"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,11 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public class Database extends SQLiteOpenHelper { | ||
private static final String DATABASE_NAME = "mdsdacpdatabase.db"; | ||
private static final int DATABASE_VERSION = 21; | ||
private static final int DATABASE_VERSION = 25; | ||
|
||
public Database(final Context context) { | ||
super(context, DATABASE_NAME, null, DATABASE_VERSION); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public interface CommentTable { | ||
String TABLE_NAME = "comment"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public interface PostTable { | ||
String TABLE_NAME = "post"; | ||
|
@@ -21,20 +21,22 @@ public interface PostTable { | |
String TITLE = "title"; | ||
String IS_MALE = "is_male"; | ||
String IS_TEEN = "is_teen"; | ||
String POST_TYPE = "post_type"; | ||
|
||
String[] ALL_COLUMNS = new String[]{ID, UPS, DOWNS, AUTHOR, CREATED, | ||
PERMALINK, TITLE, IS_MALE, IS_TEEN}; | ||
PERMALINK, TITLE, IS_MALE, IS_TEEN, POST_TYPE}; | ||
|
||
String SQL_CREATE = "CREATE TABLE " + TABLE_NAME + " ( " + ID | ||
+ " INTEGER PRIMARY KEY AUTOINCREMENT" + "," + UPS + " INTEGER" | ||
+ "," + DOWNS + " INTEGER" + "," + AUTHOR + " TEXT" + "," + CREATED | ||
+ " INTEGER" + "," + PERMALINK + " TEXT" + "," + TITLE + " TEXT" | ||
+ "," + IS_MALE + " INTEGER" + "," + IS_TEEN + " INTEGER" + " )"; | ||
+ "," + IS_MALE + " INTEGER" + "," + IS_TEEN + " INTEGER" + "," | ||
+ POST_TYPE + " INTEGER" + " )"; | ||
|
||
String SQL_INSERT = "INSERT INTO " + TABLE_NAME + " (" + UPS + "," + DOWNS | ||
+ "," + AUTHOR + "," + CREATED + "," + PERMALINK + "," + TITLE | ||
+ "," + IS_MALE + "," + IS_TEEN | ||
+ ") VALUES ( ?, ?, ?, ?, ?, ?, ?, ? )"; | ||
+ "," + IS_MALE + "," + IS_TEEN + "," + POST_TYPE | ||
+ ") VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ? )"; | ||
|
||
String SQL_DROP = "DROP TABLE IF EXISTS " + TABLE_NAME; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public class Comment { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* Generated Class. Do not modify! | ||
* | ||
* @author MDSDACP Team - [email protected] | ||
* @date 2014.01.06 | ||
* @date 2014.01.25 | ||
*/ | ||
public class Post { | ||
|
||
|
@@ -23,6 +23,7 @@ public class Post { | |
private java.lang.String title; | ||
private int is_male; | ||
private int is_teen; | ||
private int post_type; | ||
|
||
private final ContentValues values = new ContentValues(); | ||
|
||
|
@@ -40,6 +41,7 @@ public Post(final Cursor cursor) { | |
setTitle(cursor.getString(cursor.getColumnIndex(PostTable.TITLE))); | ||
setIs_male(cursor.getInt(cursor.getColumnIndex(PostTable.IS_MALE))); | ||
setIs_teen(cursor.getInt(cursor.getColumnIndex(PostTable.IS_TEEN))); | ||
setPost_type(cursor.getInt(cursor.getColumnIndex(PostTable.POST_TYPE))); | ||
|
||
} | ||
|
||
|
@@ -214,6 +216,25 @@ public int getIs_teen() { | |
return this.is_teen; | ||
} | ||
|
||
/** | ||
* Set post_type and set content value | ||
* | ||
* @param post_type from type int | ||
*/ | ||
public void setPost_type(final int post_type) { | ||
this.post_type = post_type; | ||
this.values.put(PostTable.POST_TYPE, post_type); | ||
} | ||
|
||
/** | ||
* Get post_type | ||
* | ||
* @return post_type from type int | ||
*/ | ||
public int getPost_type() { | ||
return this.post_type; | ||
} | ||
|
||
/** | ||
* Get ContentValues | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
gen-count=10 | ||
gen-count=11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.sobremesa.waywt.enums; | ||
|
||
import java.util.HashMap; | ||
|
||
public enum PostType { | ||
INVALID(0), WAYWT(1), OUTFIT_FEEDBACK(2), RECENT_PURCHASES(3); | ||
|
||
private static final HashMap<Integer, PostType> idToTypeMap = new HashMap<Integer, PostType>(); | ||
static { | ||
for (PostType type : values()) { | ||
idToTypeMap.put(type.getId(), type); | ||
} | ||
} | ||
|
||
private int mId; | ||
|
||
private PostType(int id) { | ||
mId = id; | ||
} | ||
|
||
public int getId() { | ||
return mId; | ||
} | ||
|
||
public String getIdString() { | ||
return Integer.toString(mId); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.