parent
c3248699cf
commit
632886f2b1
@ -0,0 +1,47 @@
|
||||
package com.example;
|
||||
|
||||
|
||||
import com.example.bean.QuestBean;
|
||||
import com.example.greendao.QuestBeanDao;
|
||||
|
||||
|
||||
|
||||
public class LoveDao {
|
||||
/**
|
||||
* 添加数据
|
||||
*
|
||||
* @param questBean
|
||||
*/
|
||||
public static void insertLove(QuestBean questBean) {
|
||||
MyApplication.getDaoInstant().getQuestBeanDao().insertOrReplace(questBean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
// public static void deleteLove(long id) {
|
||||
// MyApplication.getDaoInstant().getQuestBeanDao().deleteByKey(id);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 更新数据
|
||||
*
|
||||
* @param shop
|
||||
*/
|
||||
public static void updateLove(QuestBean shop) {
|
||||
MyApplication.getDaoInstant().getQuestBeanDao().update(shop);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件为id=id的数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static QuestBean queryLove(String id) {
|
||||
|
||||
return MyApplication.getDaoInstant().getQuestBeanDao().queryBuilder().where(QuestBeanDao.Properties.Id.eq(id)).list().get(0);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue