diff options
Diffstat (limited to 'src/org/traccar/database/SimpleObjectManager.java')
-rw-r--r-- | src/org/traccar/database/SimpleObjectManager.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/database/SimpleObjectManager.java b/src/org/traccar/database/SimpleObjectManager.java index 031f91fc5..0f6a9e6a4 100644 --- a/src/org/traccar/database/SimpleObjectManager.java +++ b/src/org/traccar/database/SimpleObjectManager.java @@ -99,7 +99,7 @@ public abstract class SimpleObjectManager { if (items.containsKey(item.getId())) { updateCachedItem(item); } else { - items.put(item.getId(), item); + addNewItem(item); } } for (Long cachedItemId : items.keySet()) { @@ -127,9 +127,13 @@ public abstract class SimpleObjectManager { } } + protected void addNewItem(BaseModel item) { + items.put(item.getId(), item); + } + public void addItem(BaseModel item) throws SQLException { dataManager.addObject(item); - items.put(item.getId(), item); + addNewItem(item); } protected void updateCachedItem(BaseModel item) { |