Search in sources :

Example 6 with Dao

use of com.j256.ormlite.dao.Dao in project ETSMobile-Android2 by ApplETS.

the class NoteManager method getElementsEvaluation.

public List<ElementEvaluation> getElementsEvaluation(ListeDesElementsEvaluation listeDesElementsEvaluation) {
    DatabaseHelper dbHelper = new DatabaseHelper(context);
    List<ElementEvaluation> elementEvaluationList = null;
    try {
        Dao<ElementEvaluation, String> elementsEvaluationDao = dbHelper.getDao(ElementEvaluation.class);
        QueryBuilder<ElementEvaluation, String> builder = elementsEvaluationDao.queryBuilder();
        Where where = builder.where();
        where.eq("listeDesElementsEvaluation_id", listeDesElementsEvaluation);
        where.and();
        elementEvaluationList = builder.query();
    } catch (SQLException e) {
        Log.e("SQL Exception", e.getMessage());
    }
    return elementEvaluationList;
}
Also used : DatabaseHelper(ca.etsmtl.applets.etsmobile.db.DatabaseHelper) SQLException(java.sql.SQLException) Where(com.j256.ormlite.stmt.Where) ElementEvaluation(ca.etsmtl.applets.etsmobile.model.ElementEvaluation)

Aggregations

SQLException (java.sql.SQLException)6 DatabaseHelper (ca.etsmtl.applets.etsmobile.db.DatabaseHelper)5 ElementEvaluation (ca.etsmtl.applets.etsmobile.model.ElementEvaluation)3 Where (com.j256.ormlite.stmt.Where)3 DialogInterface (android.content.DialogInterface)1 AlertDialog (android.support.v7.app.AlertDialog)1 OnClickListener (android.view.View.OnClickListener)1 DataManager (ca.etsmtl.applets.etsmobile.http.DataManager)1 MonETSNotificationsRequest (ca.etsmtl.applets.etsmobile.http.MonETSNotificationsRequest)1 FicheEmploye (ca.etsmtl.applets.etsmobile.model.FicheEmploye)1 ListeDesElementsEvaluation (ca.etsmtl.applets.etsmobile.model.ListeDesElementsEvaluation)1 MonETSNotification (ca.etsmtl.applets.etsmobile.model.MonETSNotification)1 MonETSNotificationList (ca.etsmtl.applets.etsmobile.model.MonETSNotificationList)1 ExpandableListAdapter (ca.etsmtl.applets.etsmobile.ui.adapter.ExpandableListAdapter)1 Dao (com.j256.ormlite.dao.Dao)1 RuntimeExceptionDao (com.j256.ormlite.dao.RuntimeExceptionDao)1 QueryBuilder (com.j256.ormlite.stmt.QueryBuilder)1 SpiceException (com.octo.android.robospice.persistence.exception.SpiceException)1 HashMap (java.util.HashMap)1