[#4022] NullPointerException when generating SQLite table with composite primary key

This commit is contained in:
Lukas Eder 2015-02-03 18:55:26 +01:00
parent c7121a23c0
commit 4a5ab98d83

View File

@ -83,8 +83,8 @@ public class SQLiteTableDefinition extends AbstractTableDefinition {
// SQLite identities are primary keys whose tables are mentioned in
// sqlite_sequence
boolean pk = record.getValue("pk", Boolean.class);
boolean identity = pk && existsSqliteSequence() && create()
int pk = record.getValue("pk", int.class);
boolean identity = pk > 0 && existsSqliteSequence() && create()
.fetchOne("select count(*) from sqlite_sequence where name = ?", getName())
.getValue(0, Boolean.class);