/** * Due to type erasure collision, we cannot simply use "remove" as a method name here. */ public void removeByKeys(@Nullable Collection<Long> ids) { if (ids == null || ids.isEmpty()) { return; } Cursor<T> cursor = getWriter(); try { for (long key : ids) { cursor.deleteEntity(key); } commitWriter(cursor); } finally { releaseWriter(cursor); } }
/** * Removes (deletes) the Object by its ID. */ public void remove(long id) { Cursor<T> cursor = getWriter(); try { cursor.deleteEntity(id); commitWriter(cursor); } finally { releaseWriter(cursor); } }
/** * Removes (deletes) Objects by their ID in a single transaction. */ public void remove(@Nullable long... ids) { if (ids == null || ids.length == 0) { return; } Cursor<T> cursor = getWriter(); try { for (long key : ids) { cursor.deleteEntity(key); } commitWriter(cursor); } finally { releaseWriter(cursor); } }
/** * Removes (deletes) the given Objects in a single transaction. */ @SuppressWarnings("Duplicates") // Detected duplicate has different type public void remove(@Nullable Collection<T> objects) { if (objects == null || objects.isEmpty()) { return; } Cursor<T> cursor = getWriter(); try { for (T entity : objects) { long key = cursor.getId(entity); cursor.deleteEntity(key); } commitWriter(cursor); } finally { releaseWriter(cursor); } }
/** * Removes (deletes) the given Objects in a single transaction. */ @SuppressWarnings("Duplicates") // Detected duplicate has different type public void remove(@Nullable T... objects) { if (objects == null || objects.length == 0) { return; } Cursor<T> cursor = getWriter(); try { for (T entity : objects) { long key = cursor.getId(entity); cursor.deleteEntity(key); } commitWriter(cursor); } finally { releaseWriter(cursor); } }
long id = targetIdGetter.getId(target); if (id != 0) { targetCursor.deleteEntity(id);
/** * Removes (deletes) the given Object. */ public void remove(T object) { Cursor<T> cursor = getWriter(); try { long key = cursor.getId(object); cursor.deleteEntity(key); commitWriter(cursor); } finally { releaseWriter(cursor); } }
cursor.deleteEntity(key);