GreenDao how to update table by other column (not the primary key id)?

43 Views Asked by At

I know I can use these code to update the table, but it use the primary key id for comparison.

DaoSession daoSession = ((App) getApplication()).getDaoSession();
StudentDao studentDao = daoSession.getStudentDao();
studentDao.update(studentBean);   //update by id

But sometimes, I need to use other column to update the table, it maybe like:

UPDATE STUDENT_TABLE SET ADDRESS = 'Texas' WHERE NAME = 'David';

How to implement the above sql statement with greendao?

0

There are 0 best solutions below