@Override public Long getKey(Follower entity) { if (entity != null) { return entity.getId(); } else { return null; } }
@Override protected final void bindValues(DatabaseStatement stmt, Follower entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } stmt.bindString(2, entity.getUid()); stmt.bindString(3, entity.getTid()); stmt.bindString(4, entity.getName()); String pinyinName = entity.getPinyinName(); if (pinyinName != null) { stmt.bindString(5, pinyinName); } String gender = entity.getGender(); if (gender != null) { stmt.bindString(6, gender); } String description = entity.getDescription(); if (description != null) { stmt.bindString(7, description); } String avatar = entity.getAvatar(); if (avatar != null) { stmt.bindString(8, avatar); } Integer verified = entity.getVerified(); if (verified != null) { stmt.bindLong(9, verified); } Integer verifiedType = entity.getVerifiedType(); if (verifiedType != null) { stmt.bindLong(10, verifiedType); } Integer following = entity.getFollowing(); if (following != null) { stmt.bindLong(11, following); } Integer followMe = entity.getFollowMe(); if (followMe != null) { stmt.bindLong(12, followMe); } }
@Override public boolean hasKey(Follower entity) { return entity.getId() != null; }