/** @inheritdoc */ @Override public Long getKey(Unit entity) { if (entity != null) { return entity.getId(); } else { return null; } }
/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, Unit entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } stmt.bindString(2, entity.getName()); String shortName = entity.getShortName(); if (shortName != null) { stmt.bindString(3, shortName); } Long facultyId = entity.getFacultyId(); if (facultyId != null) { stmt.bindLong(4, facultyId); } }