You can download the code for this example here:
OnyxDevTools/onyx-database-samples/persisting-data ... BatchDeletingDataExample.java.
Previously we explained how to perform batch persistence. Onyx Database also provides a method to perform batch deleting using the Persistence Manager.
- Get an Entity Persistence Manager via the Persistence Manager Factory
- Persist some test data to use later to delete.
- Query the recently created entities
- Invoke EmbeddedPerstistenceManager#deleteEntities and pass the list of entities as an argument.
- Execute the same query in step 3 to attempt to fetch the deleted entities and confirm that they were deleted
- Annotation Reference Guide