docs: update unit of work

This commit is contained in:
Ilkka Seppälä
2024-05-23 09:27:34 +03:00
parent 84df9ad48a
commit e5e406a71f
4 changed files with 52 additions and 30 deletions
@@ -44,7 +44,7 @@ public class App {
var silverTrident = new Weapon(3, "silver trident");
// create repository
var weaponRepository = new ArmsDealer(new HashMap<String, List<Weapon>>(),
var weaponRepository = new ArmsDealer(new HashMap<>(),
new WeaponDatabase());
// perform operations on the weapons
@@ -73,7 +73,7 @@ public class ArmsDealer implements UnitOfWork<Weapon> {
*/
@Override
public void commit() {
if (context == null || context.size() == 0) {
if (context == null || context.isEmpty()) {
return;
}
LOGGER.info("Commit started");