GreenDao直接执行sql

 表名和字段名最好不要自己写,使用greendao的方法调用,避免表名和字段名出错

String strSql = "update " + daoSession.getEnforceLawExamineBeanDao().getTablename() +
                                    " set " + EnforceLawExamineBeanDao.Properties.Frequency.columnName + " =" + e.getFrequency() + 1
                                    + " where "
//                                    + EnforceLawExamineBeanDao.Properties.Id.columnName + "=" + e.getId();
                                    + EnforceLawExamineBeanDao.Properties.FormId.columnName + "='" + e.getFormId()+"'";

                            daoSession.getDatabase().execSQL(strSql);

 

你可能感兴趣的:(GreenDao)