Count Vs Exists (ARCH8063)
هذا المحتوى غير متوفر بلغتك بعد.
Key kotlin.orm.count-vs-exists · Severity info · Category orm
Flags count() > 0 or findAll().size checks used only to test presence - the database can stop at the first row with exists.
Incorrect
Section titled “Incorrect”if (repo.count() > 0)Correct
Section titled “Correct”if (repo.existsById(id))Use exists / existsBy / LIMIT 1 for presence checks.