mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
book serialization is now usable
This commit is contained in:
parent
ff3ea90821
commit
59a7c6b697
8 changed files with 60 additions and 23 deletions
|
@ -496,10 +496,10 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
} else {
|
||||
long seriesId;
|
||||
try {
|
||||
myGetSeriesIdStatement.bindString(1, seriesInfo.Name);
|
||||
myGetSeriesIdStatement.bindString(1, seriesInfo.Title);
|
||||
seriesId = myGetSeriesIdStatement.simpleQueryForLong();
|
||||
} catch (SQLException e) {
|
||||
myInsertSeriesStatement.bindString(1, seriesInfo.Name);
|
||||
myInsertSeriesStatement.bindString(1, seriesInfo.Title);
|
||||
seriesId = myInsertSeriesStatement.executeInsert();
|
||||
}
|
||||
myInsertBookSeriesStatement.bindLong(1, bookId);
|
||||
|
@ -516,7 +516,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
final Cursor cursor = myDatabase.rawQuery("SELECT Series.name,BookSeries.book_index FROM BookSeries INNER JOIN Series ON Series.series_id = BookSeries.series_id WHERE BookSeries.book_id = ?", new String[] { "" + bookId });
|
||||
SeriesInfo info = null;
|
||||
if (cursor.moveToNext()) {
|
||||
info = new SeriesInfo(cursor.getString(0), SeriesInfo.createIndex(cursor.getString(1)));
|
||||
info = SeriesInfo.createSeriesInfo(cursor.getString(0), cursor.getString(1));
|
||||
}
|
||||
cursor.close();
|
||||
return info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue