Zum Inhalt springen

Query Inside Loop (ARCH8064)

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Key kotlin.orm.query-inside-loop · Severity warning · Category orm

Flags ad-hoc queries (jdbcTemplate.query, entityManager.createQuery, execSQL) issued inside a loop body - broader than the repository N+1 rule.

for (id in ids) jdbc.queryForObject(sql, id)
jdbc.query(sqlWithIn, ids)

Batch the query (IN clause, a join) before the loop.