I have a hibernate query which selects particular data from two tables using its model class based on certain conditions.Now i want to convert that query to ORMLite query to use in my android application,but i didn't know how to do it in ORMLite because I am a beginner in ORMLite.Somebody please help me to solve this.
Query query=getCurrentSession().createQuery("SELECT A.accountID,A.name,B.allowTransactions from Payments A,Accounts B where A.accountID=B.id AND A.id not in (5,55,602) and A.active=1 and B.parentID=:pID AND B.date BETWEEN :sDate AND :eDate GROUP BY A.id ORDER BY CASE WHEN A.name=:name THEN 1 ELSE 0 END,A.name");
query.setParameter("pID",4);
query.setParameter("name", "Others");
query.setParameter("sDate",startDate);
query.setParameter("eDate", endDate);
Below are the getter method for Payments and Accounts classes.
dbHelper.getPaymentDao() and dbHelper.getAccountDao()
Aucun commentaire:
Enregistrer un commentaire