*/
private long getRowIdForRow(final Object[] row, boolean required) throws SqlJetException {
if (tableDef.isRowIdPrimaryKey()) {
final int primaryKeyColumnNumber = tableDef.getColumnNumber(tableDef.getRowIdPrimaryKeyColumnName());
if (primaryKeyColumnNumber == -1 || primaryKeyColumnNumber >= row.length)
throw new SqlJetException(SqlJetErrorCode.ERROR);
final Object rowIdParam = row[primaryKeyColumnNumber];
if (null != rowIdParam) {
if (rowIdParam instanceof Long) {
long rowId = (Long) rowIdParam;
if (rowId > 0) {
return rowId;
} else {
throw new SqlJetException(SqlJetErrorCode.MISUSE,
"INTEGER PRIMARY KEY column must be more than zero");
}
} else {
throw new SqlJetException(SqlJetErrorCode.MISUSE,
"INTEGER PRIMARY KEY column must have only integer value");
}
}
}
if (required) {