Esempio n. 1
0
  /** @inheritdoc */
  @Override
  protected void bindValues(SQLiteStatement stmt, NoticeBean entity) {
    stmt.clearBindings();

    Long id = entity.getId();
    if (id != null) {
      stmt.bindLong(1, id);
    }

    String noticeTitle = entity.getNoticeTitle();
    if (noticeTitle != null) {
      stmt.bindString(2, noticeTitle);
    }

    String noticeContent = entity.getNoticeContent();
    if (noticeContent != null) {
      stmt.bindString(3, noticeContent);
    }

    String noticeTime = entity.getNoticeTime();
    if (noticeTime != null) {
      stmt.bindString(4, noticeTime);
    }

    String noticePublisher = entity.getNoticePublisher();
    if (noticePublisher != null) {
      stmt.bindString(5, noticePublisher);
    }
  }
Esempio n. 2
0
 /** @inheritdoc */
 @Override
 public void readEntity(Cursor cursor, NoticeBean entity, int offset) {
   entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));
   entity.setNoticeTitle(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1));
   entity.setNoticeContent(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2));
   entity.setNoticeTime(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3));
   entity.setNoticePublisher(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4));
 }
Esempio n. 3
0
 /** @inheritdoc */
 @Override
 public Long getKey(NoticeBean entity) {
   if (entity != null) {
     return entity.getId();
   } else {
     return null;
   }
 }
Esempio n. 4
0
 /** @inheritdoc */
 @Override
 protected Long updateKeyAfterInsert(NoticeBean entity, long rowId) {
   entity.setId(rowId);
   return rowId;
 }