Android Open Source - nl.fhict.intellicloud.answers.android Intellicloud Db Contract






From Project

Back to project page nl.fhict.intellicloud.answers.android.

License

The source code is released under:

Apache License

If you think the Android project nl.fhict.intellicloud.answers.android 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

package nl.fhict.intellicloud.answers.backendcommunication;
/*ww w .  j  a  v  a  2  s . com*/

import java.util.Date;

import nl.fhict.intellicloud.answers.Answer;
import nl.fhict.intellicloud.answers.FeedbackState;
import nl.fhict.intellicloud.answers.FeedbackType;
import nl.fhict.intellicloud.answers.Question;
import nl.fhict.intellicloud.answers.User;
import android.provider.BaseColumns;

/**
 * IntellicloudAnswersDbContract.java
 * 
 * Database contract for creating local syncable database
 * There is no need to instantiate this class directly, please use inner classes
 * 
 * @author BartvanDrongelen
 *
 */
public class IntellicloudDbContract {
  public IntellicloudDbContract () {}
  
  public static abstract class QuestionsEntry implements BaseColumns {
    public static final String TABLE_NAME = "questions";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_BACKEND_ID = "backend_id";
    public static final String COLUMN_ASKER_ID = "asker_id";
    public static final String COLUMN_ANSWERER_ID = "answerer_id";
    public static final String COLUMN_QUESTION = "question";
    public static final String COLUMN_QUESTIONSTATE = "question_state";
    public static final String COLUMN_DATE = "date";
    public static final String COLUMN_IS_PRIVATE = "is_private";
    public static final String COLUMN_TITLE = "title";
    public static final String COLUMN_ANSWER_ID = "answer";
    public static final String COLUMN_TIMESTAMP = "timestamp";

  }
  public static abstract class AnswersEntry implements BaseColumns {
    public static final String TABLE_NAME = "answers";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_BACKEND_ID = "backend_id";
    public static final String COLUMN_ANSWER = "answer";
    public static final String COLUMN_ANSWERER_ID = "answerer_id";
    public static final String COLUMN_QUESTION_ID = "question";
    public static final String COLUMN_ANSWERSTATE = "answer_state";
    public static final String COLUMN_DATE = "date";
    public static final String COLUMN_TIMESTAMP = "timestamp";
    
    
    
  }
  public static abstract class ReviewsEntry implements BaseColumns {
    public static final String TABLE_NAME = "reviews";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_BACKEND_ID = "backend_id";
    public static final String COLUMN_REVIEW = "review";
    public static final String COLUMN_REVIEWER_ID = "reviewer_id";
    public static final String COLUMN_ANSWER_ID = "answer_id";
    public static final String COLUMN_REVIEWSTATE = "review_state";
    public static final String COLUMN_DATE = "date";
    public static final String COLUMN_TIMESTAMP = "timestamp";
    
  }
  public static abstract class FeedbackEntry implements BaseColumns {
    public static final String TABLE_NAME = "feedback";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_BACKEND_ID = "backend_id";
    public static final String COLUMN_DATE = "date";
    public static final String COLUMN_FEEDBACK = "feedback";
    public static final String COLUMN_USER_ID = "user_id";
    public static final String COLUMN_QUESTION_ID = "question_id";
    public static final String COLUNN_ANSWER_ID = "answer_id";
    public static final String COLUMN_FEEDBACK_STATE = "feedback_state";
    public static final String COLUMN_FEEDBACK_TYPE = "feedback_type";
    public static final String COLUMN_TIMESTAMP = "timestamp";
    
  }
  public static abstract class UsersEntry implements BaseColumns {
    public static final String TABLE_NAME = "users";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_BACKEND_ID = "backend_id";
    public static final String COLUMN_FIRSTNAME = "first_name";
    public static final String COLUMN_LASTNAME = "last_name";
    public static final String COLUMN_INFIX = "infix";
    public static final String COLUMN_USERTYPE = "user_type";
    public static final String COLUMN_TIMESTAMP = "timestamp";
    
    public static final String[] ALL_COLUMNS = {COLUMN_ID, COLUMN_BACKEND_ID, COLUMN_FIRSTNAME, COLUMN_LASTNAME, COLUMN_INFIX, COLUMN_USERTYPE};
    
  }
  public static class CreateStatements{
    public static final String CREATE_TABLE_QUESTIONS = "CREATE TABLE IF NOT EXISTS "
          + QuestionsEntry.TABLE_NAME + 
        "(" + QuestionsEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
        + QuestionsEntry.COLUMN_BACKEND_ID + " INTEGER, "
        + QuestionsEntry.COLUMN_QUESTION + " TEXT, "
        + QuestionsEntry.COLUMN_ASKER_ID + " INTEGER, "
        + QuestionsEntry.COLUMN_ANSWERER_ID + " INTEGER, "
        + QuestionsEntry.COLUMN_ANSWER_ID + " INTEGER, "
        + QuestionsEntry.COLUMN_DATE + " INTEGER, "
        + QuestionsEntry.COLUMN_IS_PRIVATE + " INTEGER,"
            + QuestionsEntry.COLUMN_TITLE + " TEXT, "
        + QuestionsEntry.COLUMN_QUESTIONSTATE + " TEXT,"
        + QuestionsEntry.COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
        + " );";
      public static final String CREATE_TABLE_ANSWERS = "CREATE TABLE IF NOT EXISTS "
          + AnswersEntry.TABLE_NAME + 
            "(" + AnswersEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
            + AnswersEntry.COLUMN_BACKEND_ID + " INTEGER, "
            + AnswersEntry.COLUMN_ANSWER + " TEXT, "
            + AnswersEntry.COLUMN_ANSWERER_ID + " INTEGER, "
            + AnswersEntry.COLUMN_DATE + " INTEGER,"
            + AnswersEntry.COLUMN_QUESTION_ID + " INTEGER, "
            + AnswersEntry.COLUMN_ANSWERSTATE + " TEXT, "
            + AnswersEntry.COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
            + " );";
      public static final String CREATE_TABLE_REVIEWS = "CREATE TABLE IF NOT EXISTS "
          + ReviewsEntry.TABLE_NAME + 
            "(" + ReviewsEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
            + ReviewsEntry.COLUMN_BACKEND_ID + " INTEGER,"
            + ReviewsEntry.COLUMN_REVIEW + " TEXT, "
            + ReviewsEntry.COLUMN_REVIEWER_ID + " INTEGER, "
            + ReviewsEntry.COLUMN_ANSWER_ID + " INTEGER, "
            + ReviewsEntry.COLUMN_REVIEWSTATE + " TEXT,"
            + ReviewsEntry.COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
            + " );";
      public static final String CREATE_TABLE_USERS = "CREATE TABLE IF NOT EXISTS "
          + UsersEntry.TABLE_NAME + 
            "(" + UsersEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
            + UsersEntry.COLUMN_BACKEND_ID + " INTEGER,"
            + UsersEntry.COLUMN_FIRSTNAME + " TEXT, "
            + UsersEntry.COLUMN_LASTNAME + " TEXT, "
            + UsersEntry.COLUMN_INFIX + " TEXT, "
            + UsersEntry.COLUMN_USERTYPE + " TEXT,"
            + UsersEntry.COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
            + " );";
      public static final String CREATE_TABLE_FEEDBACK = "CREATE TABLE IF NOT EXISTS "
            + FeedbackEntry.TABLE_NAME + 
              "(" + FeedbackEntry.COLUMN_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " 
              + FeedbackEntry.COLUMN_BACKEND_ID + " INTEGER, "
              + FeedbackEntry.COLUMN_FEEDBACK + " TEXT, "
              + FeedbackEntry.COLUMN_FEEDBACK_STATE + " TEXT,"
              + FeedbackEntry.COLUMN_FEEDBACK_TYPE + " TEXT,"
              + FeedbackEntry.COLUMN_QUESTION_ID + " INTEGER,"
              + FeedbackEntry.COLUNN_ANSWER_ID + " INTEGER,"
              + FeedbackEntry.COLUMN_USER_ID + " INTEGER,"
              + FeedbackEntry.COLUMN_TIMESTAMP + " DATETIME DEFAULT CURRENT_TIMESTAMP"
              + " );";
       
     

  }
}




Java Source Code List

nl.fhict.intellicloud.answers.AddReviewActivity.java
nl.fhict.intellicloud.answers.AnswerState.java
nl.fhict.intellicloud.answers.Answer.java
nl.fhict.intellicloud.answers.AuthorizationActivity.java
nl.fhict.intellicloud.answers.FeedbackState.java
nl.fhict.intellicloud.answers.FeedbackType.java
nl.fhict.intellicloud.answers.Feedback.java
nl.fhict.intellicloud.answers.FilterList.java
nl.fhict.intellicloud.answers.GetUserIdTask.java
nl.fhict.intellicloud.answers.IUserFoundObserver.java
nl.fhict.intellicloud.answers.IncomingQuestionsListAdapter.java
nl.fhict.intellicloud.answers.ListFragment.java
nl.fhict.intellicloud.answers.MainActivity.java
nl.fhict.intellicloud.answers.OriginalAnswerActivity.java
nl.fhict.intellicloud.answers.QuestionListOnClickListener.java
nl.fhict.intellicloud.answers.QuestionState.java
nl.fhict.intellicloud.answers.Question.java
nl.fhict.intellicloud.answers.RejectedAnswerActivity.java
nl.fhict.intellicloud.answers.ReviewListAdapter.java
nl.fhict.intellicloud.answers.ReviewOverviewActivity.java
nl.fhict.intellicloud.answers.ReviewState.java
nl.fhict.intellicloud.answers.Review.java
nl.fhict.intellicloud.answers.SendAnswerActivity.java
nl.fhict.intellicloud.answers.SlidingMenuListAdapter.java
nl.fhict.intellicloud.answers.UserType.java
nl.fhict.intellicloud.answers.User.java
nl.fhict.intellicloud.answers.backendcommunication.AnswerDataSource.java
nl.fhict.intellicloud.answers.backendcommunication.AnswerSync.java
nl.fhict.intellicloud.answers.backendcommunication.AuthenticatorService.java
nl.fhict.intellicloud.answers.backendcommunication.Authenticator.java
nl.fhict.intellicloud.answers.backendcommunication.BackendContentProvider.java
nl.fhict.intellicloud.answers.backendcommunication.BackendSyncAdapter.java
nl.fhict.intellicloud.answers.backendcommunication.BackendSyncService.java
nl.fhict.intellicloud.answers.backendcommunication.DummyBackend.java
nl.fhict.intellicloud.answers.backendcommunication.IAnswerService.java
nl.fhict.intellicloud.answers.backendcommunication.IClaimService.java
nl.fhict.intellicloud.answers.backendcommunication.IQuestionService.java
nl.fhict.intellicloud.answers.backendcommunication.IReviewService.java
nl.fhict.intellicloud.answers.backendcommunication.IUserService.java
nl.fhict.intellicloud.answers.backendcommunication.IntellicloudDbContract.java
nl.fhict.intellicloud.answers.backendcommunication.LocalStorageSQLiteHelper.java
nl.fhict.intellicloud.answers.backendcommunication.QuestionDataSource.java
nl.fhict.intellicloud.answers.backendcommunication.QuestionsSync.java
nl.fhict.intellicloud.answers.backendcommunication.ReviewDataSource.java
nl.fhict.intellicloud.answers.backendcommunication.ReviewSync.java
nl.fhict.intellicloud.answers.backendcommunication.ServerAccessor.java
nl.fhict.intellicloud.answers.backendcommunication.SyncHelper.java
nl.fhict.intellicloud.answers.backendcommunication.UserDataSource.java
nl.fhict.intellicloud.answers.backendcommunication.UserSync.java
nl.fhict.intellicloud.answers.backendcommunication.oauth.AuthenticationManager.java