ISQLitePreparedStatement getPreparedInsert(SquidDatabase db, Table table, TableStatement.ConflictAlgorithm conflictAlgorithm) { Class<? extends TableModel> modelClass = table.getModelClass(); ISQLitePreparedStatement[] preparedStatements = preparedStatementCache.get(modelClass); if (preparedStatements == null) { preparedStatements = new ISQLitePreparedStatement[TableStatement.ConflictAlgorithm.values().length]; preparedStatementCache.put(modelClass, preparedStatements); } if (conflictAlgorithm == null) { conflictAlgorithm = TableStatement.ConflictAlgorithm.NONE; } ISQLitePreparedStatement toReturn = preparedStatements[conflictAlgorithm.ordinal()]; if (toReturn == null) { toReturn = prepareInsert(db, table, conflictAlgorithm); preparedStatements[conflictAlgorithm.ordinal()] = toReturn; } return toReturn; }
ISQLitePreparedStatement getPreparedInsert(SquidDatabase db, Table table, TableStatement.ConflictAlgorithm conflictAlgorithm) { Class<? extends TableModel> modelClass = table.getModelClass(); ISQLitePreparedStatement[] preparedStatements = preparedStatementCache.get(modelClass); if (preparedStatements == null) { preparedStatements = new ISQLitePreparedStatement[TableStatement.ConflictAlgorithm.values().length]; preparedStatementCache.put(modelClass, preparedStatements); } if (conflictAlgorithm == null) { conflictAlgorithm = TableStatement.ConflictAlgorithm.NONE; } ISQLitePreparedStatement toReturn = preparedStatements[conflictAlgorithm.ordinal()]; if (toReturn == null) { toReturn = prepareInsert(db, table, conflictAlgorithm); preparedStatements[conflictAlgorithm.ordinal()] = toReturn; } return toReturn; }