mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-09-08 00:17:07 +00:00
docs: update unit of work
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user