Android Open Source - Quiz Base Dao Wrapper






From Project

Back to project page Quiz.

License

The source code is released under:

GNU General Public License

If you think the Android project Quiz 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 com.mlaskows.quiz.model.dao;
/*from   w  w w  .  j ava 2s.  c  om*/
import java.sql.SQLException;

import roboguice.inject.InjectResource;
import android.util.Log;

import com.j256.ormlite.dao.BaseDaoImpl;
import com.mlaskows.quiz.R;

//TODO figure out how to organize DAOs
public class BaseDaoWrapper<T, ID> extends BaseDaoImpl<T, ID> {

  /** Application name. */
  @InjectResource(R.string.app_name)
  private String applicationName;

  /** Error string. */
  @InjectResource(R.string.error)
  private String errorString;
  
  protected BaseDaoWrapper(Class<T> dataClass) throws SQLException {
    super(dataClass);
    // TODO Auto-generated constructor stub
  }

  @Override
  public int update(T arg0) {
    try {
      return super.update(arg0);
    } catch (SQLException e) {
      Log.e(applicationName, errorString, e);
      return 0;
    }
  }
  
}




Java Source Code List

com.mlaskows.quiz.QuizApplication.java
com.mlaskows.quiz.activity.ExerciseActivity.java
com.mlaskows.quiz.activity.FullScreenActivity.java
com.mlaskows.quiz.activity.LevelsActivity.java
com.mlaskows.quiz.activity.MainActivity.java
com.mlaskows.quiz.activity.ScoreActivity.java
com.mlaskows.quiz.activity.clicklistener.LevelResetListener.java
com.mlaskows.quiz.activity.util.ActivityStarter.java
com.mlaskows.quiz.activity.util.BundleBuilder.java
com.mlaskows.quiz.adapter.LevelsAdapter.java
com.mlaskows.quiz.model.DatabaseHelper.java
com.mlaskows.quiz.model.XmlDataLoader.java
com.mlaskows.quiz.model.dao.AnswerDao.java
com.mlaskows.quiz.model.dao.BaseDaoWrapper.java
com.mlaskows.quiz.model.dao.ExerciseDao.java
com.mlaskows.quiz.model.dao.LevelDao.java
com.mlaskows.quiz.model.dao.QuestionDao.java
com.mlaskows.quiz.model.dao.ScoringDao.java
com.mlaskows.quiz.model.entity.Answer.java
com.mlaskows.quiz.model.entity.Exercise.java
com.mlaskows.quiz.model.entity.Level.java
com.mlaskows.quiz.model.entity.Question.java
com.mlaskows.quiz.model.entity.Quiz.java
com.mlaskows.quiz.model.entity.Scoring.java
com.mlaskows.quiz.model.enums.AnswerType.java
com.mlaskows.quiz.model.enums.QuestionType.java
com.mlaskows.quiz.utility.ImageUtility.java