Java Code Examples for android.database.sqlite.SQLiteStatement#bindLong()

The following examples show how to use android.database.sqlite.SQLiteStatement#bindLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChatLogDao.java    From Android-IM with Apache License 2.0 6 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, ChatLog entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    Long userId = entity.getUserId();
    if (userId != null) {
        stmt.bindLong(2, userId);
    }
 
    String time = entity.getTime();
    if (time != null) {
        stmt.bindString(3, time);
    }
 
    String content = entity.getContent();
    if (content != null) {
        stmt.bindString(4, content);
    }
}
 
Example 2
Source File: StudentImageCollectionEventDao.java    From ml-authentication with Apache License 2.0 6 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, StudentImageCollectionEvent entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, entity.getDeviceId());
    stmt.bindLong(3, timeConverter.convertToDatabaseValue(entity.getTime()));
    stmt.bindLong(4, entity.getStudentId());
 
    String meanFeatureVector = entity.getMeanFeatureVector();
    if (meanFeatureVector != null) {
        stmt.bindString(5, meanFeatureVector);
    }
}
 
Example 3
Source File: SQLiteAndroidDatabase.java    From react-native-sqlite-storage with MIT License 6 votes vote down vote up
private void bindArgsToStatement(SQLiteStatement myStatement, ReadableArray sqlArgs) {
    if (sqlArgs == null)
        return;

    for (int i = 0; i < sqlArgs.size(); i++) {
        ReadableType type = sqlArgs.getType(i);
        if (type == ReadableType.Number) {
            double tmp = sqlArgs.getDouble(i);
            if (tmp == (long) tmp) {
                myStatement.bindLong(i + 1, (long) tmp);
            } else {
                myStatement.bindDouble(i + 1, tmp);
            }
        } else if (sqlArgs.isNull(i)) {
            myStatement.bindNull(i + 1);
        } else {
            myStatement.bindString(i + 1, sqlArgs.getString(i));
        }
    }
}
 
Example 4
Source File: JoinAudiosWithNumbersDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, JoinAudiosWithNumbers entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, entity.getAudioId());
    stmt.bindLong(3, entity.getNumberId());
}
 
Example 5
Source File: ProvinceEntityDao.java    From easyweather with MIT License 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, ProvinceEntity entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
 
    String provinceName = entity.getProvinceName();
    if (provinceName != null) {
        stmt.bindString(2, provinceName);
    }
}
 
Example 6
Source File: JoinImagesWithNumbersDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, JoinImagesWithNumbers entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, entity.getImageId());
    stmt.bindLong(3, entity.getNumberId());
}
 
Example 7
Source File: StudentImageFeatureDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, StudentImageFeature entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, timeCreatedConverter.convertToDatabaseValue(entity.getTimeCreated()));
    stmt.bindString(3, entity.getFeatureVector());
}
 
Example 8
Source File: TraceDao.java    From OpenHub with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, Trace entity) {
    stmt.clearBindings();
    stmt.bindString(1, entity.getId());
 
    String type = entity.getType();
    if (type != null) {
        stmt.bindString(2, type);
    }
 
    String userId = entity.getUserId();
    if (userId != null) {
        stmt.bindString(3, userId);
    }
 
    Long repoId = entity.getRepoId();
    if (repoId != null) {
        stmt.bindLong(4, repoId);
    }
 
    java.util.Date startTime = entity.getStartTime();
    if (startTime != null) {
        stmt.bindLong(5, startTime.getTime());
    }
 
    java.util.Date latestTime = entity.getLatestTime();
    if (latestTime != null) {
        stmt.bindLong(6, latestTime.getTime());
    }
 
    Integer traceNum = entity.getTraceNum();
    if (traceNum != null) {
        stmt.bindLong(7, traceNum);
    }
}
 
Example 9
Source File: GroupMemberEntityDao.java    From Android with MIT License 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, GroupMemberEntity entity) {
    stmt.clearBindings();
 
    Long _id = entity.get_id();
    if (_id != null) {
        stmt.bindLong(1, _id);
    }
    stmt.bindString(2, entity.getIdentifier());
    stmt.bindString(3, entity.getUsername());
    stmt.bindString(4, entity.getAvatar());
    stmt.bindString(5, entity.getAddress());
 
    Integer role = entity.getRole();
    if (role != null) {
        stmt.bindLong(6, role);
    }
 
    String nick = entity.getNick();
    if (nick != null) {
        stmt.bindString(7, nick);
    }
 
    String pub_key = entity.getPub_key();
    if (pub_key != null) {
        stmt.bindString(8, pub_key);
    }
}
 
Example 10
Source File: AlbumInfoDao.java    From SweetMusicPlayer with Apache License 2.0 5 votes vote down vote up
/** @inheritdoc */
@Override
protected void bindValues(SQLiteStatement stmt, AlbumInfo entity) {
    stmt.clearBindings();
 
    Long albumId = entity.getAlbumId();
    if (albumId != null) {
        stmt.bindLong(1, albumId);
    }
 
    String title = entity.getTitle();
    if (title != null) {
        stmt.bindString(2, title);
    }
 
    String artist = entity.getArtist();
    if (artist != null) {
        stmt.bindString(3, artist);
    }
 
    Integer numSongs = entity.getNumSongs();
    if (numSongs != null) {
        stmt.bindLong(4, numSongs);
    }
 
    String albumArt = entity.getAlbumArt();
    if (albumArt != null) {
        stmt.bindString(5, albumArt);
    }
}
 
Example 11
Source File: ImageDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, Image entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindString(2, localeConverter.convertToDatabaseValue(entity.getLocale()));
 
    Calendar timeLastUpdate = entity.getTimeLastUpdate();
    if (timeLastUpdate != null) {
        stmt.bindLong(3, timeLastUpdateConverter.convertToDatabaseValue(timeLastUpdate));
    }
    stmt.bindLong(4, entity.getRevisionNumber());
    stmt.bindString(5, contentStatusConverter.convertToDatabaseValue(entity.getContentStatus()));
    stmt.bindString(6, entity.getContentType());
 
    Set literacySkills = entity.getLiteracySkills();
    if (literacySkills != null) {
        stmt.bindString(7, literacySkillsConverter.convertToDatabaseValue(literacySkills));
    }
 
    Set numeracySkills = entity.getNumeracySkills();
    if (numeracySkills != null) {
        stmt.bindString(8, numeracySkillsConverter.convertToDatabaseValue(numeracySkills));
    }
    stmt.bindString(9, entity.getTitle());
    stmt.bindString(10, imageFormatConverter.convertToDatabaseValue(entity.getImageFormat()));
 
    String dominantColor = entity.getDominantColor();
    if (dominantColor != null) {
        stmt.bindString(11, dominantColor);
    }
}
 
Example 12
Source File: BookMarkUserDao.java    From OpenHub with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, BookMarkUser entity) {
    stmt.clearBindings();
    stmt.bindString(1, entity.getLogin());
 
    String name = entity.getName();
    if (name != null) {
        stmt.bindString(2, name);
    }
 
    String avatarUrl = entity.getAvatarUrl();
    if (avatarUrl != null) {
        stmt.bindString(3, avatarUrl);
    }
 
    Integer followers = entity.getFollowers();
    if (followers != null) {
        stmt.bindLong(4, followers);
    }
 
    Integer following = entity.getFollowing();
    if (following != null) {
        stmt.bindLong(5, following);
    }
 
    java.util.Date markTime = entity.getMarkTime();
    if (markTime != null) {
        stmt.bindLong(6, markTime.getTime());
    }
}
 
Example 13
Source File: StudentImageDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, StudentImage entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, timeCollectedConverter.convertToDatabaseValue(entity.getTimeCollected()));
    stmt.bindString(3, entity.getImageFileUrl());
    stmt.bindLong(4, entity.getStudentImageFeatureId());
    stmt.bindLong(5, entity.getStudentImageCollectionEventId());
}
 
Example 14
Source File: JoinNumbersWithWordsDao.java    From ml-authentication with Apache License 2.0 5 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, JoinNumbersWithWords entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindLong(2, entity.getNumberId());
    stmt.bindLong(3, entity.getWordId());
}
 
Example 15
Source File: Database.java    From wifi_backend with GNU General Public License v3.0 5 votes vote down vote up
private static SQLiteStatement bind(SQLiteStatement statement, AccessPoint accessPoint, int start) {
    if(!TextUtils.isEmpty(accessPoint.ssid())) {
        statement.bindString(start, accessPoint.ssid());
    }
    statement.bindString(start + 1, String.valueOf(accessPoint.estimateLocation().latitude()));
    statement.bindString(start + 2, String.valueOf(accessPoint.estimateLocation().longitude()));
    statement.bindString(start + 3, String.valueOf(accessPoint.estimateLocation().radius()));
    statement.bindString(start + 4, String.valueOf(accessPoint.moveGuard()));
    statement.bindLong(start + 5 ,changedValue(accessPoint));
    bind(statement, accessPoint.sample(0), start + 6);
    bind(statement, accessPoint.sample(1), start + 8);
    bind(statement, accessPoint.sample(2), start + 10);
    return statement;
}
 
Example 16
Source File: GroupEntityDao.java    From Android with MIT License 4 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, GroupEntity entity) {
    stmt.clearBindings();
 
    Long _id = entity.get_id();
    if (_id != null) {
        stmt.bindLong(1, _id);
    }
    stmt.bindString(2, entity.getIdentifier());
 
    String name = entity.getName();
    if (name != null) {
        stmt.bindString(3, name);
    }
 
    String ecdh_key = entity.getEcdh_key();
    if (ecdh_key != null) {
        stmt.bindString(4, ecdh_key);
    }
 
    Integer common = entity.getCommon();
    if (common != null) {
        stmt.bindLong(5, common);
    }
 
    Integer verify = entity.getVerify();
    if (verify != null) {
        stmt.bindLong(6, verify);
    }
 
    Integer pub = entity.getPub();
    if (pub != null) {
        stmt.bindLong(7, pub);
    }
 
    String avatar = entity.getAvatar();
    if (avatar != null) {
        stmt.bindString(8, avatar);
    }
 
    String summary = entity.getSummary();
    if (summary != null) {
        stmt.bindString(9, summary);
    }
}
 
Example 17
Source File: ChapterBeanDao.java    From HaoReader with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, ChapterBean entity) {
    stmt.clearBindings();
 
    String durChapterUrl = entity.getDurChapterUrl();
    if (durChapterUrl != null) {
        stmt.bindString(1, durChapterUrl);
    }
 
    String nextChapterUrl = entity.getNextChapterUrl();
    if (nextChapterUrl != null) {
        stmt.bindString(2, nextChapterUrl);
    }
 
    String durChapterName = entity.getDurChapterName();
    if (durChapterName != null) {
        stmt.bindString(3, durChapterName);
    }
 
    String durChapterPlayUrl = entity.getDurChapterPlayUrl();
    if (durChapterPlayUrl != null) {
        stmt.bindString(4, durChapterPlayUrl);
    }
 
    String noteUrl = entity.getNoteUrl();
    if (noteUrl != null) {
        stmt.bindString(5, noteUrl);
    }
 
    Integer durChapterIndex = entity.getDurChapterIndex();
    if (durChapterIndex != null) {
        stmt.bindLong(6, durChapterIndex);
    }
 
    Integer start = entity.getStart();
    if (start != null) {
        stmt.bindLong(7, start);
    }
 
    Integer end = entity.getEnd();
    if (end != null) {
        stmt.bindLong(8, end);
    }
}
 
Example 18
Source File: UserDao.java    From TLint with Apache License 2.0 4 votes vote down vote up
/**
 * @inheritdoc
 */
@Override
protected void bindValues(SQLiteStatement stmt, User entity) {
    stmt.clearBindings();

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

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

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

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

    String icon = entity.getIcon();
    if (icon != null) {
        stmt.bindString(5, icon);
    }

    Integer sex = entity.getSex();
    if (sex != null) {
        stmt.bindLong(6, sex);
    }

    String cookie = entity.getCookie();
    if (cookie != null) {
        stmt.bindString(7, cookie);
    }

    String registerTime = entity.getRegisterTime();
    if (registerTime != null) {
        stmt.bindString(8, registerTime);
    }

    String location = entity.getLocation();
    if (location != null) {
        stmt.bindString(9, location);
    }

    String school = entity.getSchool();
    if (school != null) {
        stmt.bindString(10, school);
    }

    String threadUrl = entity.getThreadUrl();
    if (threadUrl != null) {
        stmt.bindString(11, threadUrl);
    }

    String postUrl = entity.getPostUrl();
    if (postUrl != null) {
        stmt.bindString(12, postUrl);
    }

    String nickNameUrl = entity.getNickNameUrl();
    if (nickNameUrl != null) {
        stmt.bindString(13, nickNameUrl);
    }
}
 
Example 19
Source File: AllophoneDao.java    From ml-authentication with Apache License 2.0 4 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, Allophone entity) {
    stmt.clearBindings();
 
    Long id = entity.getId();
    if (id != null) {
        stmt.bindLong(1, id);
    }
    stmt.bindString(2, localeConverter.convertToDatabaseValue(entity.getLocale()));
 
    Calendar timeLastUpdate = entity.getTimeLastUpdate();
    if (timeLastUpdate != null) {
        stmt.bindLong(3, timeLastUpdateConverter.convertToDatabaseValue(timeLastUpdate));
    }
    stmt.bindLong(4, entity.getRevisionNumber());
    stmt.bindString(5, contentStatusConverter.convertToDatabaseValue(entity.getContentStatus()));
    stmt.bindString(6, entity.getValueIpa());
    stmt.bindString(7, entity.getValueSampa());
    stmt.bindLong(8, entity.getDiacritic() ? 1L: 0L);
 
    SoundType soundType = entity.getSoundType();
    if (soundType != null) {
        stmt.bindString(9, soundTypeConverter.convertToDatabaseValue(soundType));
    }
 
    VowelLength vowelLength = entity.getVowelLength();
    if (vowelLength != null) {
        stmt.bindString(10, vowelLengthConverter.convertToDatabaseValue(vowelLength));
    }
 
    VowelHeight vowelHeight = entity.getVowelHeight();
    if (vowelHeight != null) {
        stmt.bindString(11, vowelHeightConverter.convertToDatabaseValue(vowelHeight));
    }
 
    VowelFrontness vowelFrontness = entity.getVowelFrontness();
    if (vowelFrontness != null) {
        stmt.bindString(12, vowelFrontnessConverter.convertToDatabaseValue(vowelFrontness));
    }
 
    LipRounding lipRounding = entity.getLipRounding();
    if (lipRounding != null) {
        stmt.bindString(13, lipRoundingConverter.convertToDatabaseValue(lipRounding));
    }
 
    ConsonantType consonantType = entity.getConsonantType();
    if (consonantType != null) {
        stmt.bindString(14, consonantTypeConverter.convertToDatabaseValue(consonantType));
    }
 
    ConsonantPlace consonantPlace = entity.getConsonantPlace();
    if (consonantPlace != null) {
        stmt.bindString(15, consonantPlaceConverter.convertToDatabaseValue(consonantPlace));
    }
 
    ConsonantVoicing consonantVoicing = entity.getConsonantVoicing();
    if (consonantVoicing != null) {
        stmt.bindString(16, consonantVoicingConverter.convertToDatabaseValue(consonantVoicing));
    }
    stmt.bindLong(17, entity.getUsageCount());
}
 
Example 20
Source File: BookDao.java    From MissZzzReader with Apache License 2.0 4 votes vote down vote up
@Override
protected final void bindValues(SQLiteStatement stmt, Book entity) {
    stmt.clearBindings();
 
    String id = entity.getId();
    if (id != null) {
        stmt.bindString(1, id);
    }
 
    String name = entity.getName();
    if (name != null) {
        stmt.bindString(2, name);
    }
 
    String chapterUrl = entity.getChapterUrl();
    if (chapterUrl != null) {
        stmt.bindString(3, chapterUrl);
    }
 
    String imgUrl = entity.getImgUrl();
    if (imgUrl != null) {
        stmt.bindString(4, imgUrl);
    }
 
    String desc = entity.getDesc();
    if (desc != null) {
        stmt.bindString(5, desc);
    }
 
    String author = entity.getAuthor();
    if (author != null) {
        stmt.bindString(6, author);
    }
 
    String type = entity.getType();
    if (type != null) {
        stmt.bindString(7, type);
    }
 
    String updateDate = entity.getUpdateDate();
    if (updateDate != null) {
        stmt.bindString(8, updateDate);
    }
 
    String newestChapterId = entity.getNewestChapterId();
    if (newestChapterId != null) {
        stmt.bindString(9, newestChapterId);
    }
 
    String newestChapterTitle = entity.getNewestChapterTitle();
    if (newestChapterTitle != null) {
        stmt.bindString(10, newestChapterTitle);
    }
 
    String newestChapterUrl = entity.getNewestChapterUrl();
    if (newestChapterUrl != null) {
        stmt.bindString(11, newestChapterUrl);
    }
 
    String historyChapterId = entity.getHistoryChapterId();
    if (historyChapterId != null) {
        stmt.bindString(12, historyChapterId);
    }
    stmt.bindLong(13, entity.getHisttoryChapterNum());
    stmt.bindLong(14, entity.getSortCode());
    stmt.bindLong(15, entity.getNoReadNum());
    stmt.bindLong(16, entity.getChapterTotalNum());
    stmt.bindLong(17, entity.getLastReadPosition());
 
    String source = entity.getSource();
    if (source != null) {
        stmt.bindString(18, source);
    }
}